diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-09-30 21:35:05 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-09-30 21:35:05 +0000 |
commit | acc88e52f399dbc121170ab7ec3b0d4b99d58a72 (patch) | |
tree | 49f8642ed6944891f5068fe1dd4ee6f4af9ac92b /perl_checker.src/lexer.mll | |
parent | 0b850271c67750aa15d413152863286a0b949e56 (diff) | |
download | perl-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.mll | 3 |
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) } |