diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-02-12 11:27:26 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-02-12 11:27:26 +0000 |
commit | f4603c474d329c04f596dae4fe33f020a1e50a23 (patch) | |
tree | ae76400e08a6fc9db0debbeaaa363cec7519a64b /perl_checker.src/parser_helper.ml | |
parent | 59478369faed0a81220d374470f448596ede5bc3 (diff) | |
download | perl_checker-f4603c474d329c04f596dae4fe33f020a1e50a23.tar perl_checker-f4603c474d329c04f596dae4fe33f020a1e50a23.tar.gz perl_checker-f4603c474d329c04f596dae4fe33f020a1e50a23.tar.bz2 perl_checker-f4603c474d329c04f596dae4fe33f020a1e50a23.tar.xz perl_checker-f4603c474d329c04f596dae4fe33f020a1e50a23.zip |
warn when "ref" priority is badly handled by perl_checker
Diffstat (limited to 'perl_checker.src/parser_helper.ml')
-rw-r--r-- | perl_checker.src/parser_helper.ml | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml index 680b571..622f55f 100644 --- a/perl_checker.src/parser_helper.ml +++ b/perl_checker.src/parser_helper.ml @@ -265,12 +265,15 @@ let check_parenthesized_first_argexpr word ((_, e), (_, (start, _)) as ex) = if word = "time" then die_rule "please use time() instead of time"; sp_p(ex) -let check_parenthesized_first_argexpr_with_Ident ident ((_, e), _ as ex) = +let check_parenthesized_first_argexpr_with_Ident ident ((prio, e), _ as ex) = + if prio = P_tok then (); (match ident with | Ident(Some _, _, _) -> (match e with | [e] when is_parenthesized e -> () | _ -> warn_rule "use parentheses around argument (otherwise it might cause syntax errors if the package is \"require\"d and not \"use\"d") + | Ident(None, word, _) when List.mem word ["ref"] -> + if prio <> P_tok then warn_rule "use parentheses around argument" | _ -> ()); check_parenthesized_first_argexpr (string_of_Ident ident) ex |