summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/parser_helper.ml
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
commit433c1f2dd33b0631ff956bc73a15cd85f8c34f50 (patch)
tree29c8500d83406a5ecadaf1eff8a0dbbb98769be8 /perl_checker.src/parser_helper.ml
parent3e35dab169f409de8622f014b2e613b4f9849ef3 (diff)
downloadperl-MDK-Common-433c1f2dd33b0631ff956bc73a15cd85f8c34f50.tar
perl-MDK-Common-433c1f2dd33b0631ff956bc73a15cd85f8c34f50.tar.gz
perl-MDK-Common-433c1f2dd33b0631ff956bc73a15cd85f8c34f50.tar.bz2
perl-MDK-Common-433c1f2dd33b0631ff956bc73a15cd85f8c34f50.tar.xz
perl-MDK-Common-433c1f2dd33b0631ff956bc73a15cd85f8c34f50.zip
check for "0 or ..."
Diffstat (limited to 'perl_checker.src/parser_helper.ml')
-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