From 213d18c0842317ae689d860d2882aac0543aeeea Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 28 Apr 2004 12:34:42 +0000 Subject: get_pos_from_expr() (previously named get_pos_from_tree()) is useful, even in parser_helper --- perl_checker.src/tree.ml | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) (limited to 'perl_checker.src/tree.ml') 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"; [] -- cgit v1.2.1