diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-12-04 13:16:15 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-12-04 13:16:15 +0000 |
commit | a329f0c34eb3f9ec1ed4f699c2962ef1cc379a8a (patch) | |
tree | 88d995d52710d0152fb727ad6dc73ed5f1524b85 /perl_checker.src/parser.mly | |
parent | 15698d0e3d680ce81348237b718834bd3b72ef15 (diff) | |
download | perl-MDK-Common-a329f0c34eb3f9ec1ed4f699c2962ef1cc379a8a.tar perl-MDK-Common-a329f0c34eb3f9ec1ed4f699c2962ef1cc379a8a.tar.gz perl-MDK-Common-a329f0c34eb3f9ec1ed4f699c2962ef1cc379a8a.tar.bz2 perl-MDK-Common-a329f0c34eb3f9ec1ed4f699c2962ef1cc379a8a.tar.xz perl-MDK-Common-a329f0c34eb3f9ec1ed4f699c2962ef1cc379a8a.zip |
- warn use of "cond ? list : ()" (use if_(cond, list) instead)
- adapt MDK::Common::* to this (using @{[]} instead of () to avoid the warning)
Diffstat (limited to 'perl_checker.src/parser.mly')
-rw-r--r-- | perl_checker.src/parser.mly | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/perl_checker.src/parser.mly b/perl_checker.src/parser.mly index 695e88a..45c0db8 100644 --- a/perl_checker.src/parser.mly +++ b/perl_checker.src/parser.mly @@ -233,10 +233,10 @@ term: | term PATTERN_MATCH_NOT STRING {die_with_rawpos (sndsnd $3) "use a regexp, not a string"} -| term QUESTION_MARK term COLON term {sp_p($2); sp_p($3); sp_p($4); sp_p($5); to_Call_op_(P_ternary, "?:", [ prio_lo P_ternary $1 ; prio_lo_after P_ternary $3; prio_lo_after P_ternary $5]) (sp_pos_range $1 $5)} -| term QUESTION_MARK term COLON BRACKET expr BRACKET_END {sp_p($2); sp_p($3); sp_p($4); sp_p($5); sp_p($6); sp_p($7); to_Call_op_(P_ternary, "?:", [ prio_lo P_ternary $1 ; prio_lo_after P_ternary $3; sndfst $6]) (sp_pos_range $1 $7)} -| term QUESTION_MARK BRACKET expr BRACKET_END COLON term {sp_p($2); sp_p($3); sp_p($4); sp_p($5); sp_p($6); sp_p($7); to_Call_op_(P_ternary, "?:", [ prio_lo P_ternary $1 ; sndfst $4; prio_lo_after P_ternary $7]) (sp_pos_range $1 $7)} -| term QUESTION_MARK BRACKET expr BRACKET_END COLON BRACKET expr BRACKET_END {sp_p($2); sp_p($3); sp_p($4); sp_p($5); sp_p($6); sp_p($7); sp_p($8); sp_p($9); to_Call_op_(P_ternary, "?:", [ prio_lo P_ternary $1 ; sndfst $4; sndfst $8]) (sp_pos_range $1 $9)} +| term QUESTION_MARK term COLON term {sp_p($2); sp_p($3); sp_p($4); sp_p($5); check_ternary_paras $3 $5; to_Call_op_(P_ternary, "?:", [ prio_lo P_ternary $1 ; prio_lo_after P_ternary $3; prio_lo_after P_ternary $5]) (sp_pos_range $1 $5)} +| term QUESTION_MARK term COLON BRACKET expr BRACKET_END {sp_p($2); sp_p($3); check_ternary_para $3; sp_p($4); sp_p($5); sp_p($6); sp_p($7); check_ternary_para $1; to_Call_op_(P_ternary, "?:", [ prio_lo P_ternary $1 ; prio_lo_after P_ternary $3; Ref(I_hash, sndfst $6)]) (sp_pos_range $1 $7)} +| term QUESTION_MARK BRACKET expr BRACKET_END COLON term {sp_p($2); sp_p($3); sp_p($4); sp_p($5); sp_p($6); sp_p($7); check_ternary_para $7; to_Call_op_(P_ternary, "?:", [ prio_lo P_ternary $1 ; Ref(I_hash, sndfst $4); prio_lo_after P_ternary $7]) (sp_pos_range $1 $7)} +| term QUESTION_MARK BRACKET expr BRACKET_END COLON BRACKET expr BRACKET_END {sp_p($2); sp_p($3); sp_p($4); sp_p($5); sp_p($6); sp_p($7); sp_p($8); sp_p($9); to_Call_op_(P_ternary, "?:", [ prio_lo P_ternary $1 ; Ref(I_hash, sndfst $4); Ref(I_hash, sndfst $8)]) (sp_pos_range $1 $9)} /* Unary operators and terms */ @@ -296,6 +296,8 @@ term: | term ARROW word_or_scalar {sp_0($2); sp_0($3); (P_tok, to_Method_call(sndfst $1, fst $3, [])), sp_pos_range $1 $3} /* $foo->bar */ | term ARROW MULT parenthesized {check_MULT_is_x $3; sp_0($2); sp_0($3); sp_0($4); (P_tok, to_Method_call(sndfst $1, Ident(None, "x", get_pos $3), sndfst $4)), sp_pos_range $1 $4} /* $foo->bar(list) */ | term ARROW MULT {check_MULT_is_x $3; sp_0($2); sp_0($3); (P_tok, to_Method_call(sndfst $1, Ident(None, "x", get_pos $3), [])), sp_pos_range $1 $3} /* $foo->bar */ +| term ARROW FOR parenthesized {sp_0($2); sp_0($3); sp_0($4); (P_tok, to_Method_call(sndfst $1, Ident(None, fst $3, get_pos $3), sndfst $4)), sp_pos_range $1 $4} /* $foo->bar(list) */ +| term ARROW FOR {sp_0($2); sp_0($3); (P_tok, to_Method_call(sndfst $1, Ident(None, fst $3, get_pos $3), [])), sp_pos_range $1 $3} /* $foo->bar */ | NEW word { sp_n($2); (P_call_no_paren, to_Method_call(fst $2, Ident(None, "new", get_pos $1), [])), sp_pos_range $1 $2} /* new Class */ | NEW word_paren parenthesized { sp_n($2); sp_0($3); (P_call_no_paren, to_Method_call(fst $2, Ident(None, "new", get_pos $1), sndfst $3)), sp_pos_range $1 $3} /* new Class(...) */ |