diff options
-rw-r--r-- | perl_checker.src/lexer.mll | 2 | ||||
-rw-r--r-- | perl_checker.src/parser.mly | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/perl_checker.src/lexer.mll b/perl_checker.src/lexer.mll index 8450aa9..d25e63c 100644 --- a/perl_checker.src/lexer.mll +++ b/perl_checker.src/lexer.mll @@ -490,7 +490,7 @@ rule token = parse | "\\" ' '* '(' { putback lexbuf 1; REF(pos lexbuf) } -| "sub" ' '+ ident ' '* '(' [ '$' '@' '\\' '&' ';' ]* ')' { +| "sub" ' '+ ident ' '* '(' [ '$' '@' '\\' '&' ';' '%' ]* ')' { (* bloody prototypes, must be caught especially otherwise "($)" is badly tokenized *) (* and alas "($@)" is both valid as an expression and a prototype *) let s = lexeme lexbuf in diff --git a/perl_checker.src/parser.mly b/perl_checker.src/parser.mly index dfbbd2f..20d9229 100644 --- a/perl_checker.src/parser.mly +++ b/perl_checker.src/parser.mly @@ -257,6 +257,7 @@ term: | PRINT { Call_op("print", var_STDOUT :: [ var_dollar_ ]), snd $1 } | PRINT argexpr {check_parenthesized_first_argexpr (fst $1) $2; Call_op("print", var_STDOUT :: fst $2), snd $1 } +| PRINT_TO_STAR { Call_op("print", Deref(I_star, Ident(None, fst $1, get_pos $1)) :: [ var_dollar_ ]), snd $1 } | PRINT_TO_STAR argexpr { Call_op("print", Deref(I_star, Ident(None, fst $1, get_pos $1)) :: fst $2), snd $1 } | PRINT_TO_SCALAR { Call_op("print", var_STDOUT :: [ Deref(I_scalar, Ident(None, fst $1, get_pos $1)) ]), snd $1 } | PRINT_TO_SCALAR argexpr { Call_op("print", Deref(I_scalar, Ident(None, fst $1, get_pos $1)) :: fst $2), snd $1 } |