Signed-off-by: Jean Privat <jean@pryen.org>
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