summaryrefslogtreecommitdiffstats
path: root/perl_checker.src
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-10-13 03:54:20 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-10-13 03:54:20 +0000
commitacb34ac9bf016b6aafdc8006425ef1d7bbdbfc50 (patch)
treec4aa488a60ea7b9175e4a4f454337efbd86298f1 /perl_checker.src
parentf31ee08f5a9401130d389037b16666dd94232b49 (diff)
downloadperl-MDK-Common-acb34ac9bf016b6aafdc8006425ef1d7bbdbfc50.tar
perl-MDK-Common-acb34ac9bf016b6aafdc8006425ef1d7bbdbfc50.tar.gz
perl-MDK-Common-acb34ac9bf016b6aafdc8006425ef1d7bbdbfc50.tar.bz2
perl-MDK-Common-acb34ac9bf016b6aafdc8006425ef1d7bbdbfc50.tar.xz
perl-MDK-Common-acb34ac9bf016b6aafdc8006425ef1d7bbdbfc50.zip
transform m@...@ and m:...: from errors into warnings (since we can handle it quite cleanly)
Diffstat (limited to 'perl_checker.src')
-rw-r--r--perl_checker.src/lexer.mll13
1 files changed, 8 insertions, 5 deletions
diff --git a/perl_checker.src/lexer.mll b/perl_checker.src/lexer.mll
index 10c3dc7..211238b 100644
--- a/perl_checker.src/lexer.mll
+++ b/perl_checker.src/lexer.mll
@@ -397,10 +397,12 @@ let hex_in_string lexbuf next_rule s =
next_s s (Stack.pop next_rule) lexbuf
let set_delimit_char lexbuf op =
- match lexeme_char lexbuf (String.length op) with
- | '@' -> die lexbuf ("don't use " ^ op ^ "@...@, replace @ with / ! , or |")
- | ':' -> die lexbuf ("don't use " ^ op ^ ":...:, replace : with / ! , or |")
- | c -> delimit_char := c
+ let c = lexeme_char lexbuf (String.length op) in
+ delimit_char := c;
+ match c with
+ | '@' -> warn lexbuf ("don't use " ^ op ^ "@...@, replace @ with / ! , or |")
+ | ':' -> warn lexbuf ("don't use " ^ op ^ ":...:, replace : with / ! , or |")
+ | _ -> ()
}
let stash = [ '$' '@' '%' '&' '*' ]
@@ -778,7 +780,8 @@ and delimited_string = parse
and re_delimited_string = parse
| '\\' { Stack.push re_delimited_string next_rule ; re_string_escape lexbuf }
| '$' { Stack.push re_delimited_string next_rule ; delimited_string_interpolate_scalar lexbuf }
-| '@' { Stack.push re_delimited_string next_rule ; delimited_string_interpolate_array lexbuf }
+| '@' { if lexeme_char lexbuf 0 <> !delimit_char then
+ (Stack.push re_delimited_string next_rule ; delimited_string_interpolate_array lexbuf) }
| '\n' {
add_a_new_line(lexeme_end lexbuf);
next re_delimited_string lexbuf