aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpsyc://loupsycedyglgamf.onion/~lynX <ircs://psyced.org/youbroketheinternet>1984-04-04 00:44:17 +0000
committerpsyc://loupsycedyglgamf.onion/~lynX <ircs://psyced.org/youbroketheinternet>1984-04-04 00:44:17 +0000
commit38fae9cf98db508a0729ba43f51b41e37daa511a (patch)
tree5e8a79d29959a518d78b1fcf287bc39a767c7d29
parentacdad277da34f0db58bd434ebd06245c3e6866b7 (diff)
downloadprep-38fae9cf98db508a0729ba43f51b41e37daa511a.tar.gz
prep-38fae9cf98db508a0729ba43f51b41e37daa511a.zip
allow #pragma tolerant for apps that can't be as strict as silvan would like
-rw-r--r--lib/prep/prep.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/prep/prep.pl b/lib/prep/prep.pl
index efe08d1..a0b4450 100644
--- a/lib/prep/prep.pl
+++ b/lib/prep/prep.pl
@@ -21,6 +21,7 @@
21# knows XY) combined flag prefixes 21# knows XY) combined flag prefixes
22# knows "#pragma or" to apply OR instead of AND with combined-flag-prefixes 22# knows "#pragma or" to apply OR instead of AND with combined-flag-prefixes
23# knows '#pragma keephash' to allow lines with leading hash sign 23# knows '#pragma keephash' to allow lines with leading hash sign
24# knows '#pragma tolerant' to ignore comments that look like directive calls
24# 25#
25# dont be surprised, this code happens to still be perl4 compliant 26# dont be surprised, this code happens to still be perl4 compliant
26 27
@@ -37,6 +38,7 @@ $block = 0;
37$level = 0; 38$level = 0;
38 39
39$keephash = 0; 40$keephash = 0;
41$tolerant = 0;
40my @out; 42my @out;
41 43
42## PUBLIC FUNCTIONS 44## PUBLIC FUNCTIONS
@@ -241,6 +243,7 @@ sub pragma {
241 $OR = 0 if /\bAND\b/io; 243 $OR = 0 if /\bAND\b/io;
242 $OR = 1 if /\bOR\b/io; 244 $OR = 1 if /\bOR\b/io;
243 $keephash = 1 if /\bKEEPHASH\b/io; 245 $keephash = 1 if /\bKEEPHASH\b/io;
246 $tolerant = 1 if /\bTOLERANT\b/io;
244} 247}
245sub require { 248sub require {
246 local($x) = @_; 249 local($x) = @_;
@@ -301,7 +304,7 @@ sub interpret {
301 304
302 my $func = "do_$cmd"; 305 my $func = "do_$cmd";
303 unless (defined &$func) { 306 unless (defined &$func) {
304 die "unrecognized $cmd directive"; 307 print STDERR "*** Unrecognized $cmd directive\n" unless $tolerant;
305 return; 308 return;
306 } 309 }
307 my $ret; 310 my $ret;