summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/lexer.mll
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-09-30 21:35:05 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-09-30 21:35:05 +0000
commitacc88e52f399dbc121170ab7ec3b0d4b99d58a72 (patch)
tree49f8642ed6944891f5068fe1dd4ee6f4af9ac92b /perl_checker.src/lexer.mll
parent0b850271c67750aa15d413152863286a0b949e56 (diff)
downloadperl-MDK-Common-acc88e52f399dbc121170ab7ec3b0d4b99d58a72.tar
perl-MDK-Common-acc88e52f399dbc121170ab7ec3b0d4b99d58a72.tar.gz
perl-MDK-Common-acc88e52f399dbc121170ab7ec3b0d4b99d58a72.tar.bz2
perl-MDK-Common-acc88e52f399dbc121170ab7ec3b0d4b99d58a72.tar.xz
perl-MDK-Common-acc88e52f399dbc121170ab7ec3b0d4b99d58a72.zip
disallow s/foo/die "bar \"zzz\"/e
Diffstat (limited to 'perl_checker.src/lexer.mll')
-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 71d6399..672ff5c 100644
--- a/perl_checker.src/lexer.mll
+++ b/perl_checker.src/lexer.mll
@@ -562,6 +562,9 @@ rule token = parse
let s2, (_, end_) = ins delimited_string lexbuf in
let opts, _ = raw_ins pattern_options lexbuf in
let pos = start, end_ in
+ if String.contains opts 'e' && sum (List.map (fun (s, _) -> count_chars_in_string s '"') s2) > 2 then
+ die lexbuf ("do not write so complicated things in the eval part of s///,\n" ^
+ "i generate wrong warnings for things like s/xxx/die \"yyy \\\"zzz\\\" \"/")
check_multi_line_delimited_string (Some opts) pos ;
PATTERN_SUBST(s1, s2, opts, pos)
}