summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/tree.ml
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-05-26 14:43:48 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-05-26 14:43:48 +0000
commit05eb4216c7614de17622622f4bc9774645acc0f0 (patch)
tree56813be9d6bb56ed70c2fcc1faf0f9653e00c684 /perl_checker.src/tree.ml
parent48294694130bec9ffe0a152e146d9c58b796e588 (diff)
downloadperl-MDK-Common-05eb4216c7614de17622622f4bc9774645acc0f0.tar
perl-MDK-Common-05eb4216c7614de17622622f4bc9774645acc0f0.tar.gz
perl-MDK-Common-05eb4216c7614de17622622f4bc9774645acc0f0.tar.bz2
perl-MDK-Common-05eb4216c7614de17622622f4bc9774645acc0f0.tar.xz
perl-MDK-Common-05eb4216c7614de17622622f4bc9774645acc0f0.zip
handle use foo() and use foo ("x", "y")
Diffstat (limited to 'perl_checker.src/tree.ml')
-rw-r--r--perl_checker.src/tree.ml10
1 files changed, 9 insertions, 1 deletions
diff --git a/perl_checker.src/tree.ml b/perl_checker.src/tree.ml
index f866e14..d576e57 100644
--- a/perl_checker.src/tree.ml
+++ b/perl_checker.src/tree.ml
@@ -77,11 +77,19 @@ let get_current_package 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" ;
[]
| Raw_string(s, pos) ->
[ s, pos ]
+ | List [] -> []
+ | List [ List l ] ->
+ List.map (function
+ | String([s, List []], pos)
+ | Raw_string(s, pos) -> s, pos
+ | Ident(_, _, pos) as ident -> string_of_Ident ident, pos
+ ) l
| _ -> internal_error "from_qw_raw"
let from_qw e =
@@ -177,7 +185,7 @@ let get_uses t =
| Use(Ident _ as pkg, _) when uses_external_package (string_of_Ident pkg) -> uses
| Use(Ident(_, _, pos) as ident, l) ->
let package = string_of_Ident ident in
- let para = if l = [] then None else Some(from_qw (List.hd l)) in
+ let para = if l = [] then None else Some(collect from_qw l) in
(package, (para, pos)) :: uses
| _ -> uses
) [] t