summaryrefslogtreecommitdiffstats
path: root/perl_checker.src
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-05-26 11:36:36 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-05-26 11:36:36 +0000
commit0d99c9e73026839ce4a7dfc4617cf7df22aef64c (patch)
tree97eac64572bfab7bfa33ca1de3b23bec18ee4f22 /perl_checker.src
parent20bfec8ac87454cb13f370fbf3c9b7a9c942199a (diff)
downloadperl_checker-0d99c9e73026839ce4a7dfc4617cf7df22aef64c.tar
perl_checker-0d99c9e73026839ce4a7dfc4617cf7df22aef64c.tar.gz
perl_checker-0d99c9e73026839ce4a7dfc4617cf7df22aef64c.tar.bz2
perl_checker-0d99c9e73026839ce4a7dfc4617cf7df22aef64c.tar.xz
perl_checker-0d99c9e73026839ce4a7dfc4617cf7df22aef64c.zip
check for "0 or ..."
Diffstat (limited to 'perl_checker.src')
-rw-r--r--perl_checker.src/parser_helper.ml5
1 files changed, 5 insertions, 0 deletions
diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml
index 944713b..dd3428f 100644
--- a/perl_checker.src/parser_helper.ml
+++ b/perl_checker.src/parser_helper.ml
@@ -642,6 +642,11 @@ let cook_call_op op para pos =
| "||", e :: _ when is_always_false e -> warn_rule "<constant> || ... is the same as ..."; call
| "&&", e :: _ when is_always_true e -> warn_rule "<constant> && ... is the same as ..."; call
+ | "or", e :: _ when is_always_true (un_parenthesize_full e) -> warn_rule "<constant> or ... is the same as <constant>"; call
+ | "and", e :: _ when is_always_false (un_parenthesize_full e) -> warn_rule "<constant> and ... is the same as <constant>"; call
+ | "or", e :: _ when is_always_false (un_parenthesize_full e) -> warn_rule "<constant> or ... is the same as ..."; call
+ | "and", e :: _ when is_always_true (un_parenthesize_full e) -> warn_rule "<constant> and ... is the same as ..."; call
+
| _ ->
call