summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/tree.ml
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-08-11 02:11:29 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-08-11 02:11:29 +0000
commitfaf98f9084397e55706fbea632d5dd9432d68f92 (patch)
tree3f18dd652def0ba88304258f2e1b5e0e706b1475 /perl_checker.src/tree.ml
parentaff050c6ba86c87d9ce962e1b4cd7d4f71aeb245 (diff)
downloadperl_checker-faf98f9084397e55706fbea632d5dd9432d68f92.tar
perl_checker-faf98f9084397e55706fbea632d5dd9432d68f92.tar.gz
perl_checker-faf98f9084397e55706fbea632d5dd9432d68f92.tar.bz2
perl_checker-faf98f9084397e55706fbea632d5dd9432d68f92.tar.xz
perl_checker-faf98f9084397e55706fbea632d5dd9432d68f92.zip
- allow $_o_XXX parameter name which is both unused and optional (same for $_b_XXX)
- shift is a ONE_SCALAR_PARA so that $box->pack_start(shift @l, 0, 0, 4) is parsed correctly - in arrange_global_vars_declared(), don't keep anything in global_vars_declared, better create shadow packages to contain them - much better merging of multiple files defining functions in the same package. This fixes the bad behaviour when using the cache (esp. do_pkgs, but it was even worse with things in ugtk2.pm)
Diffstat (limited to 'perl_checker.src/tree.ml')
-rw-r--r--perl_checker.src/tree.ml5
1 files changed, 4 insertions, 1 deletions
diff --git a/perl_checker.src/tree.ml b/perl_checker.src/tree.ml
index 929a5a3..eabf553 100644
--- a/perl_checker.src/tree.ml
+++ b/perl_checker.src/tree.ml
@@ -274,7 +274,10 @@ let get_proto perl_proto body =
| (I_array, _) :: _ :: _ -> warn_with_pos pos "an array must be the last variable in a prototype"
| (I_hash, _) :: _ :: _ -> warn_with_pos pos "an hash must be the last variable in a prototype"
| _ -> ());
- let is_optional (_, s) = String.length s > 2 && (s.[0] = 'o' || s.[0] = 'b') && s.[1] = '_' in
+ let is_optional (_, s) =
+ String.length s > 2 && (s.[0] = 'o' || s.[0] = 'b') && s.[1] = '_' ||
+ String.length s > 3 && s.[0] = '_' && (s.[1] = 'o' || s.[1] = 'b') && s.[2] = '_'
+ in
let must_have, optional = break_at is_optional scalars in
if not (List.for_all is_optional optional) then
warn_with_pos pos "an non-optional argument must not follow an optional argument";