summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/parser_helper.ml
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-12-18 16:02:09 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-12-18 16:02:09 +0000
commit2375b0413acc1f3e6659fc110c13bcc061cd320d (patch)
tree4661b764b6caa774672a30e7b7baf762293ae0b6 /perl_checker.src/parser_helper.ml
parentb852ba8ae186c776d03a44e4a63179a633aaeb52 (diff)
downloadperl_checker-2375b0413acc1f3e6659fc110c13bcc061cd320d.tar
perl_checker-2375b0413acc1f3e6659fc110c13bcc061cd320d.tar.gz
perl_checker-2375b0413acc1f3e6659fc110c13bcc061cd320d.tar.bz2
perl_checker-2375b0413acc1f3e6659fc110c13bcc061cd320d.tar.xz
perl_checker-2375b0413acc1f3e6659fc110c13bcc061cd320d.zip
new features including checking methods being available and unused functions
Diffstat (limited to 'perl_checker.src/parser_helper.ml')
-rw-r--r--perl_checker.src/parser_helper.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml
index e70e94f..19ee2da 100644
--- a/perl_checker.src/parser_helper.ml
+++ b/perl_checker.src/parser_helper.ml
@@ -389,7 +389,11 @@ let to_List = function
let deref_arraylen e = Call(Deref(I_func, Ident(None, "int", raw_pos2pos bpos)), [Deref(I_array, e)])
let to_Ident ((fq, name), (_, pos)) = Ident(fq, name, raw_pos2pos pos)
let to_Raw_string (s, (_, pos)) = Raw_string(s, raw_pos2pos pos)
-let to_Method_call (object_, method_, para) = Method_call(maybe_to_Raw_string object_, maybe_to_Raw_string method_, para)
+let to_Method_call (object_, method_, para) =
+ match method_ with
+ | Ident(Some "SUPER", name, pos) -> Method_call(maybe_to_Raw_string object_, Raw_string(name, pos), para)
+ | Ident(Some _, _, _) -> Call(Deref(I_func, method_), maybe_to_Raw_string object_ :: para)
+ | _ -> Method_call(maybe_to_Raw_string object_, maybe_to_Raw_string method_, para)
let to_Deref_with(from_context, to_context, ref_, para) =
if is_not_a_scalar ref_ then warn_rule "bad deref";
Deref_with(from_context, to_context, ref_, para)