diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-11-15 12:39:32 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-11-15 12:39:32 +0000 |
commit | 2cc500b796e072495769a9fb2ceb4674da29a1eb (patch) | |
tree | ca2fcf3ffb6c2cd9e9181ded541f56ef19f2fa23 | |
parent | 906606a48d333ba799cbd3ba6fe494893ca1f644 (diff) | |
download | perl_checker-2cc500b796e072495769a9fb2ceb4674da29a1eb.tar perl_checker-2cc500b796e072495769a9fb2ceb4674da29a1eb.tar.gz perl_checker-2cc500b796e072495769a9fb2ceb4674da29a1eb.tar.bz2 perl_checker-2cc500b796e072495769a9fb2ceb4674da29a1eb.tar.xz perl_checker-2cc500b796e072495769a9fb2ceb4674da29a1eb.zip |
*** empty log message ***
-rw-r--r-- | perl_checker.src/parser.mly | 2 | ||||
-rw-r--r-- | perl_checker.src/parser_helper.ml | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/perl_checker.src/parser.mly b/perl_checker.src/parser.mly index 6e76ad6..22911cb 100644 --- a/perl_checker.src/parser.mly +++ b/perl_checker.src/parser.mly @@ -235,7 +235,7 @@ term: | term DECR {sp_0($2); (P_tight, Call_op("-- post", [sndfst $1])), pos_range $1 $2} | NOT argexpr {(P_and, Call_op("not", sndfst $2)), pos_range $1 $2} -| DEFINED scalar {(P_expr, Call(Ident(None, "defined", get_pos $1), [fst $2])), pos_range $1 $2} +| DEFINED variable {(P_expr, Call(Ident(None, "defined", get_pos $1), [fst $2])), pos_range $1 $2} | DEFINED subscripted {(P_expr, Call(Ident(None, "defined", get_pos $1), [fst $2])), pos_range $1 $2} | DEFINED parenthesized {(P_expr, Call(Ident(None, "defined", get_pos $1), sndfst $2)), pos_range $1 $2} | DEFINED word_paren parenthesized {(P_expr, Call(Ident(None, "defined", get_pos $1), [Call(fst $2, sndfst $3)])), pos_range $1 $3} diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml index e489050..075e110 100644 --- a/perl_checker.src/parser_helper.ml +++ b/perl_checker.src/parser_helper.ml @@ -170,7 +170,8 @@ let sp_same (_, (spaces1, _) as ter1) (_, (spaces2, _) as ter2) = else if spaces2 <> Space_0 then sp_p ter1 let check_word_alone (word, _) = - if string_of_Ident word = "time" then die_rule "please use time() instead of time"; + let s = string_of_Ident word in + if s = "time" || s = "wantarray" then die_rule (sprintf "please use %s() instead of %s" s s); word let check_parenthesized_first_argexpr word ((_, e), (_, (start, _)) as ex) = |