summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/lexer.mll
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-09-30 16:50:56 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-09-30 16:50:56 +0000
commit309c1ff79cc8fa8e1d92be03fdd9496785d01149 (patch)
tree6d1dbca9d524172d9663e970b28c032dbbf8bd34 /perl_checker.src/lexer.mll
parent7fe253aab7a266a8ad02b66be19dfe8ce789f8f8 (diff)
downloadperl_checker-309c1ff79cc8fa8e1d92be03fdd9496785d01149.tar
perl_checker-309c1ff79cc8fa8e1d92be03fdd9496785d01149.tar.gz
perl_checker-309c1ff79cc8fa8e1d92be03fdd9496785d01149.tar.bz2
perl_checker-309c1ff79cc8fa8e1d92be03fdd9496785d01149.tar.xz
perl_checker-309c1ff79cc8fa8e1d92be03fdd9496785d01149.zip
nice error message for qx{...} (instead of a syntax error)
Diffstat (limited to 'perl_checker.src/lexer.mll')
-rw-r--r--perl_checker.src/lexer.mll5
1 files changed, 4 insertions, 1 deletions
diff --git a/perl_checker.src/lexer.mll b/perl_checker.src/lexer.mll
index eb43d42..b1250e3 100644
--- a/perl_checker.src/lexer.mll
+++ b/perl_checker.src/lexer.mll
@@ -639,7 +639,10 @@ rule token = parse
| stash "::" { putback lexbuf 2; ident_type_from_char None "main" lexbuf (lexeme_char lexbuf 0) }
| ident? ("::" ident)+ { ident_from_lexbuf lexbuf }
-| ident { not_ok_for_match := lexeme_end lexbuf; BAREWORD(lexeme lexbuf, pos lexbuf) }
+| ident { not_ok_for_match := lexeme_end lexbuf;
+ let word = lexeme lexbuf in
+ if word = "qx" then die lexbuf "don't use qx{...}, use `...` instead" else
+ BAREWORD(word, pos lexbuf) }
| ident ":" { LABEL(lexeme lexbuf, pos lexbuf) }