summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-04-30 09:43:20 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-04-30 09:43:20 +0000
commitdb6d91b3044879bc644da496dac771c79d03eaa4 (patch)
tree8dab492b511cbd70836b448dc970ba7d84a9bb1f
parentf3c8293bb8d26a63f1a0bd2b98e4b94fa1f69ae9 (diff)
downloadperl-MDK-Common-db6d91b3044879bc644da496dac771c79d03eaa4.tar
perl-MDK-Common-db6d91b3044879bc644da496dac771c79d03eaa4.tar.gz
perl-MDK-Common-db6d91b3044879bc644da496dac771c79d03eaa4.tar.bz2
perl-MDK-Common-db6d91b3044879bc644da496dac771c79d03eaa4.tar.xz
perl-MDK-Common-db6d91b3044879bc644da496dac771c79d03eaa4.zip
map and grep do not return a scalar
-rw-r--r--perl_checker.src/parser_helper.ml2
1 files changed, 2 insertions, 0 deletions
diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml
index e9a0398..14f288f 100644
--- a/perl_checker.src/parser_helper.ml
+++ b/perl_checker.src/parser_helper.ml
@@ -46,6 +46,8 @@ let rec is_not_a_scalar = function
| Deref(context, _) -> non_scalar_context context
| List []
| List(_ :: _ :: _) -> true
+ | Call(Deref(I_func, Ident(None, "map", _)), _)
+ | Call(Deref(I_func, Ident(None, "grep", _)), _) -> true
| Call_op("?:", [ _cond ; a; b ], _) -> is_not_a_scalar a || is_not_a_scalar b
| _ -> false