parser: perl code of prescc looks at all parameters in a line
[nit.git] / 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