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
commita111de16c12a9f5efb075b32a108597301c22da7 (patch)
tree009519d5ea86b4a0118e4ff8c571465a8bd87420
parente34793c35e7356fc73719b69e01ffba876af8615 (diff)
downloadperl-MDK-Common-a111de16c12a9f5efb075b32a108597301c22da7.tar
perl-MDK-Common-a111de16c12a9f5efb075b32a108597301c22da7.tar.gz
perl-MDK-Common-a111de16c12a9f5efb075b32a108597301c22da7.tar.bz2
perl-MDK-Common-a111de16c12a9f5efb075b32a108597301c22da7.tar.xz
perl-MDK-Common-a111de16c12a9f5efb075b32a108597301c22da7.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) ;