diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-12-16 21:17:58 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-12-16 21:17:58 +0000 |
commit | f9d1e0c2bd806c577aa2d94acc8338eb3b1c9360 (patch) | |
tree | 951cb6baabc8d6f2d69c6161cb74f9d1caf5a64c /perl_checker.src | |
parent | 16f522028d0ac4621e2d1134ebdb208ff739f91d (diff) | |
download | perl-MDK-Common-f9d1e0c2bd806c577aa2d94acc8338eb3b1c9360.tar perl-MDK-Common-f9d1e0c2bd806c577aa2d94acc8338eb3b1c9360.tar.gz perl-MDK-Common-f9d1e0c2bd806c577aa2d94acc8338eb3b1c9360.tar.bz2 perl-MDK-Common-f9d1e0c2bd806c577aa2d94acc8338eb3b1c9360.tar.xz perl-MDK-Common-f9d1e0c2bd806c577aa2d94acc8338eb3b1c9360.zip |
- drop internally operator "qw" by rewriting qw(...) into a list of strings
- as a side effect "foo" . qw(bar boo) is now detected
- allow pop(@l) (with explicit parentheses)
Diffstat (limited to 'perl_checker.src')
-rw-r--r-- | perl_checker.src/parser.mly | 2 | ||||
-rw-r--r-- | perl_checker.src/parser_helper.ml | 4 | ||||
-rw-r--r-- | perl_checker.src/tree.ml | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/perl_checker.src/parser.mly b/perl_checker.src/parser.mly index 7760424..71f8ac0 100644 --- a/perl_checker.src/parser.mly +++ b/perl_checker.src/parser.mly @@ -353,7 +353,7 @@ terminal: | RAW_STRING {new_1pesp P_tok (to_Raw_string $1) $1} | REVISION {new_1pesp P_tok (to_Raw_string $1) $1} | COMMAND_STRING {to_Call_op_ (M_mixed[M_string; M_list]) P_tok "``" [to_String false $1] $1 $1} -| QUOTEWORDS {to_Call_op_ M_list P_tok "qw" [to_Raw_string $1] $1 $1} +| QUOTEWORDS {let l = List.map (fun s -> Raw_string(s, raw_pos2pos $1.pos)) (words $1.any) in new_pesp (M_tuple (repeat M_string (List.length l))) P_tok (List [ List l ]) $1 $1} | HERE_DOC {new_1pesp P_tok (to_String false (new_1esp (fst $1.any) $1)) $1 } | RAW_HERE_DOC {new_1pesp P_tok (Raw_string(fst $1.any, raw_pos2pos (snd $1.any))) $1} | QR_PATTERN {to_Call_op_ M_string P_tok "qr//" (from_PATTERN $1) $1 $1} diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml index 1a54536..a7d48f1 100644 --- a/perl_checker.src/parser_helper.ml +++ b/perl_checker.src/parser_helper.ml @@ -409,7 +409,6 @@ let check_ternary_paras(cond, a, b) = | Num _ | Raw_string _ | String ([(_, List [])], _) - | Call_op("qw", _, _) -> true | Call(Deref(I_func, Ident(None, "N", _)), [ List(String _ :: l) ]) | Call_op(".", l, _) @@ -826,7 +825,8 @@ let call_raw force_non_builtin_func (e, para) = | "pop" | "shift" -> (match para with | [] - | [ Deref(I_array, _) ] -> () + | [ Deref(I_array, _) ] + | [ List [ Deref(I_array, _) ] ] -> () | _ -> warn_rule (f ^ " is expecting an array and nothing else")) ; None | _ -> None diff --git a/perl_checker.src/tree.ml b/perl_checker.src/tree.ml index 7e1488d..002548f 100644 --- a/perl_checker.src/tree.ml +++ b/perl_checker.src/tree.ml @@ -79,8 +79,6 @@ let get_current_package t = [ None, t ] let from_qw_raw = function - | Call_op("qw", [ Raw_string(s, pos)], _) -> - List.map (fun symbol -> symbol, pos) (words s) | String([s, List []], pos) -> [ s, pos ] | String(_, pos) -> warn_with_pos pos "not recognised yet" ; |