From 309c1ff79cc8fa8e1d92be03fdd9496785d01149 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 30 Sep 2003 16:50:56 +0000 Subject: nice error message for qx{...} (instead of a syntax error) --- perl_checker.src/lexer.mll | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'perl_checker.src/lexer.mll') 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) } -- cgit v1.2.1