summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/tree.ml
diff options
context:
space:
mode:
Diffstat (limited to 'perl_checker.src/tree.ml')
-rw-r--r--perl_checker.src/tree.ml36
1 files changed, 1 insertions, 35 deletions
diff --git a/perl_checker.src/tree.ml b/perl_checker.src/tree.ml
index 112c8b3..5c762ac 100644
--- a/perl_checker.src/tree.ml
+++ b/perl_checker.src/tree.ml
@@ -64,40 +64,6 @@ let s2context s =
| _ -> I_raw, s
-let rec get_pos_in_tree = function
- | Anonymous_sub(_, _, pos)
- | String(_, pos)
- | Call_op(_, _, pos)
- | Perl_checker_comment(_, pos)
- | My_our(_, _, pos)
- | Raw_string(_, pos)
- | Num(_, pos)
- | Ident(_, _, pos)
- -> pos
-
- | Package e
- | Ref(_, e)
- | Deref(_, e)
- | Sub_declaration(e, _, _, _)
- | Deref_with(_, _, e, _)
- | Use(e, _)
- | Call(e, _)
- | Method_call(_, e, _)
- -> get_pos_in_tree e
-
- | Diamond(option_e)
- -> if option_e = None then raw_pos2pos bpos else get_pos_in_tree (some option_e)
-
- | List l
- | Block l
- -> if l = [] then raw_pos2pos bpos else get_pos_in_tree (List.hd l)
-
- | Semi_colon
- | Too_complex
- | Undef
- | Label _
- -> raw_pos2pos bpos
-
let get_current_package t =
match t with
| Package(Ident _ as ident) :: body ->
@@ -127,7 +93,7 @@ let from_qw_raw = function
| String([s, List []], pos)
| Raw_string(s, pos) -> Some(s, pos)
| Ident(_, _, pos) as ident -> Some(string_of_Ident ident, pos)
- | e -> warn_with_pos (get_pos_in_tree e) "not recognised yet"; None
+ | e -> warn_with_pos (get_pos_from_expr e) "not recognised yet"; None
) l)) []
| e -> warn_with_pos (get_pos_in_tree e) "not recognised yet"; []