From: Jean Privat Date: Thu, 30 Jul 2009 14:08:33 +0000 (-0400) Subject: parser: perl code of prescc looks at all parameters in a line X-Git-Tag: v0.3~96 X-Git-Url: http://nitlanguage.org parser: perl code of prescc looks at all parameters in a line Signed-off-by: Jean Privat --- diff --git a/src/parser/prescc.sh b/src/parser/prescc.sh index b84a0fb..e5ab277 100755 --- a/src/parser/prescc.sh +++ b/src/parser/prescc.sh @@ -63,7 +63,7 @@ printf "/* This file is autogenerated, do not modify it */" > "$outfile" cat "$infile" >> "$outfile" # The perl code is used to list all the available parameters in the extended grammar -for token in `perl -ne 'while (s/\~([a-zA-Z]+)// && !$found{$1}) {print "$1\n"; $found{$1}=1}' "$infile"` +for token in `perl -ne 'while (/\~([a-zA-Z]+)/g) {if (!$found{$1}) {print "$1\n"; $found{$1}=1}}' "$infile"` do echo "Parameter ~$token" # first, sed starts from first line to the AST line and removes ~xxx and !xxx