summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/parser_helper.ml
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-11-18 14:26:44 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-11-18 14:26:44 +0000
commit659ced82c2465f81c3f14a1fa601d7df9ce2d2da (patch)
tree146f2f1eb50e7d708aef157494601531b13c1452 /perl_checker.src/parser_helper.ml
parent2cc500b796e072495769a9fb2ceb4674da29a1eb (diff)
downloadperl_checker-659ced82c2465f81c3f14a1fa601d7df9ce2d2da.tar
perl_checker-659ced82c2465f81c3f14a1fa601d7df9ce2d2da.tar.gz
perl_checker-659ced82c2465f81c3f14a1fa601d7df9ce2d2da.tar.bz2
perl_checker-659ced82c2465f81c3f14a1fa601d7df9ce2d2da.tar.xz
perl_checker-659ced82c2465f81c3f14a1fa601d7df9ce2d2da.zip
*** empty log message ***
Diffstat (limited to 'perl_checker.src/parser_helper.ml')
-rw-r--r--perl_checker.src/parser_helper.ml12
1 files changed, 11 insertions, 1 deletions
diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml
index 075e110..ebd5cfd 100644
--- a/perl_checker.src/parser_helper.ml
+++ b/perl_checker.src/parser_helper.ml
@@ -105,7 +105,6 @@ let prio_lo pri_out ((pri_in, e), (_, pos)) =
| P_paren (P_paren_wanted _) -> ()
| P_paren pri_in' ->
if pri_in' <> pri_out &&
- pri_out <> P_assign &&
prio_less(pri_in', pri_out) && not_complex (un_parenthesize e) then
warn pos "unneeded parentheses"
| _ -> ())
@@ -269,6 +268,17 @@ let call(e, para) =
| [ Ident _ ] -> ()
| [ String _ ] -> ()
| _ -> die_rule "use either \"require PACKAGE\" or \"require 'PACKAGE.pm'\"")
+ | Ident(None, "N", _) ->
+ (match para with
+ | [List(String _ :: _)] -> ()
+ | _ -> die_rule "N() must be used with a string")
| _ -> ());
Call(e, para)
+let call_one_scalar_para (e, (_, pos)) para =
+ let pri =
+ match e with
+ | "defined" -> P_expr
+ | _ -> P_add
+ in
+ pri, Call(Ident(None, e, raw_pos2pos pos), para)