summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-12-16 20:51:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-12-16 20:51:16 +0000
commit86a7fcf28bf540baf62dbac43b7a53f99254bd0f (patch)
tree81fa64f98e9e7386e7ff9ccbcb28489b56a97dc9
parent85b5f253f4b01bc0a6b5e63a9467cc5491c1f474 (diff)
downloadperl-MDK-Common-86a7fcf28bf540baf62dbac43b7a53f99254bd0f.tar
perl-MDK-Common-86a7fcf28bf540baf62dbac43b7a53f99254bd0f.tar.gz
perl-MDK-Common-86a7fcf28bf540baf62dbac43b7a53f99254bd0f.tar.bz2
perl-MDK-Common-86a7fcf28bf540baf62dbac43b7a53f99254bd0f.tar.xz
perl-MDK-Common-86a7fcf28bf540baf62dbac43b7a53f99254bd0f.zip
"@hash{@l}" is ''. @hash{@l} .'', and not ''. @hash .'{'. @l .'}'
-rw-r--r--perl_checker.src/lexer.mll9
1 files changed, 6 insertions, 3 deletions
diff --git a/perl_checker.src/lexer.mll b/perl_checker.src/lexer.mll
index 981e245..225d21a 100644
--- a/perl_checker.src/lexer.mll
+++ b/perl_checker.src/lexer.mll
@@ -390,6 +390,8 @@ let ident_start = ['a'-'z' 'A'-'Z' '_']
let ident = ident_start ['0'-'9' 'A'-'Z' 'a'-'z' '_'] *
let pattern_separator = [ '/' '!' ',' '|' '@' ]
+let in_string_expr = (ident | (ident? ("::" ident)+)) "->"? (('{' [^ '{' '}' '\n']* '}') | ('[' [^ '[' ']' '\n']* ']'))*
+
rule token = parse
| [' ' '\t']+ {
(* propagate not_ok_for_match when it was set by the previous token *)
@@ -887,7 +889,7 @@ and string_interpolate_scalar = parse
| '$' ident
| ['0'-'9']
| '{' [^ '{' '}']* '}'
-| (ident | (ident? ("::" ident)+)) "->"? (('{' [^ '{' '}' '\n']* '}') | ('[' [^ '[' ']' '\n']* ']'))*
+| in_string_expr
| [^ '{' '}' ' ' '\n' '"'] { (* eg: $! $$ *)
string_interpolate token "$" lexbuf
}
@@ -926,7 +928,7 @@ and delimited_string_interpolate_scalar = parse (* needed for delimited string l
and string_interpolate_array = parse
| '$' ident
| '{' [^ '{' '}']* '}'
-| (ident | (ident? ("::" ident)+)) { string_interpolate token "@" lexbuf }
+| in_string_expr { string_interpolate token "@" lexbuf }
| [ '@' '*' '<' '>' ']' '.' '(' ' ' ] { next_s ("@" ^ lexeme lexbuf) (Stack.pop next_rule) lexbuf }
| '"' { putback lexbuf 1; next_s "@" (Stack.pop next_rule) lexbuf }
@@ -936,7 +938,8 @@ and string_interpolate_array = parse
and delimited_string_interpolate_array = parse
| '$' ident
| '{' [^ '{' '}']* '}'
-| (ident | (ident? ("::" ident)+)) { string_interpolate token "@" lexbuf }
+| in_string_expr
+ { string_interpolate token "@" lexbuf }
| [ '@' '*' '<' '>' ']' '.' '(' ' ' ] { next_s ("@" ^ lexeme lexbuf) (Stack.pop next_rule) lexbuf }
| eof { next_s "@" (Stack.pop next_rule) lexbuf }