parser: perl code of prescc looks at all parameters in a line
authorJean Privat <jean@pryen.org>
Thu, 30 Jul 2009 14:08:33 +0000 (10:08 -0400)
committerJean Privat <jean@pryen.org>
Thu, 30 Jul 2009 17:25:56 +0000 (13:25 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/parser/prescc.sh

index b84a0fb..e5ab277 100755 (executable)
@@ -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