summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-06-22 12:07:50 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-06-22 12:07:50 +0000
commit9f649387a454ba91408bbc631232048b82ba103f (patch)
tree4012446a22b50b31d60eaa0c7653e28d28f1b58a
parent43e641edb0ad385f7aec2c3acd8bea01e6593815 (diff)
downloadperl_checker-9f649387a454ba91408bbc631232048b82ba103f.tar
perl_checker-9f649387a454ba91408bbc631232048b82ba103f.tar.gz
perl_checker-9f649387a454ba91408bbc631232048b82ba103f.tar.bz2
perl_checker-9f649387a454ba91408bbc631232048b82ba103f.tar.xz
perl_checker-9f649387a454ba91408bbc631232048b82ba103f.zip
don't suggest replacing \Q with Q, warn "don't use \\Q, use quotemeta instead" instead
-rw-r--r--perl_checker.src/lexer.mll3
1 files changed, 3 insertions, 0 deletions
diff --git a/perl_checker.src/lexer.mll b/perl_checker.src/lexer.mll
index aca8d03..f416499 100644
--- a/perl_checker.src/lexer.mll
+++ b/perl_checker.src/lexer.mll
@@ -914,6 +914,9 @@ and string_escape = parse
| 'x' [^ '{'] _ { string_escape_useful := Left true; hex_in_string lexbuf next_rule (skip_n_char 1 (lexeme lexbuf)) }
| '\n' { die lexbuf "do not use \"\\\" before end-of-line, it's useless and generally bad" }
| '\\'{ next_s "\\" (Stack.pop next_rule) lexbuf }
+| 'Q' {
+ warn [Warn_complex_expressions] lexbuf ("don't use \\Q, use quotemeta instead");
+ string_escape_useful := Left true; next_s ("\\" ^ lexeme lexbuf) (Stack.pop next_rule) lexbuf }
| ['b' 'f' 'a' 'r'] { string_escape_useful := Left true; next_s ("\\" ^ lexeme lexbuf) (Stack.pop next_rule) lexbuf }
| ['$' '@' '%' '{' '[' ':'] {
if !string_escape_useful = Left false then string_escape_useful := Right (lexeme_char lexbuf 0) ;