Mercurial > octave-nkf
comparison libinterp/parse-tree/oct-parse.in.yy @ 18126:d76f790b4eec gui-release
enable do_braindead_shortcircuit_evaluation by default and deprecate
* octave.cc (maximum_braindamage): Don't call
Fdo_brainded_shortcircuit_evaluation.
* pt-exp.h (tree_expression::mark_braindead_shortcircuit): Eliminate
file name argument.
* pt-binop.h, pt-binop.cc
(tree_binary_expression::mark_braindead_shortcircuit): Likewise.
* oct-parse.in.yy (if_cmd_list1, elseif_clause, loop_command):
Eliminate argument from call to mark_braindead_shortcircuit.
* pt-binop.h, pt-binop.cc (Vdo_braindead_shortcircuit_evaluation):
Initialize to true.
(tree_binary_expression::matlab_style_short_circuit_warning): New function.
(tree_binary_expression::rvalue1): Call
matlab_style_short_circuit_warning if short circuit evaluation occurs.
(Fdo_braindead_shortcircuit_evaluation): Display deprecated warning.
Delete tests for do_braindead_shortcircuit_evaluation.
(tree_binary_expression::braindead_shortcircuit_warning_issued): New
member variable.
* NEWS: Mention change in default value and deprecated function.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 11 Dec 2013 20:51:22 -0500 |
parents | 6b51f5f44aea |
children | c7b68a11074b 4cf930a64fad |
comparison
equal
deleted
inserted
replaced
18107:834549618a52 | 18126:d76f790b4eec |
---|---|
941 } | 941 } |
942 ; | 942 ; |
943 | 943 |
944 if_cmd_list1 : expression stmt_begin opt_sep opt_list | 944 if_cmd_list1 : expression stmt_begin opt_sep opt_list |
945 { | 945 { |
946 $1->mark_braindead_shortcircuit (lexer.fcn_file_full_name); | 946 $1->mark_braindead_shortcircuit (); |
947 | 947 |
948 $$ = parser.start_if_command ($1, $4); | 948 $$ = parser.start_if_command ($1, $4); |
949 } | 949 } |
950 | if_cmd_list1 elseif_clause | 950 | if_cmd_list1 elseif_clause |
951 { | 951 { |
954 } | 954 } |
955 ; | 955 ; |
956 | 956 |
957 elseif_clause : ELSEIF stash_comment opt_sep expression stmt_begin opt_sep opt_list | 957 elseif_clause : ELSEIF stash_comment opt_sep expression stmt_begin opt_sep opt_list |
958 { | 958 { |
959 $4->mark_braindead_shortcircuit (lexer.fcn_file_full_name); | 959 $4->mark_braindead_shortcircuit (); |
960 | 960 |
961 $$ = parser.make_elseif_clause ($1, $4, $7, $2); | 961 $$ = parser.make_elseif_clause ($1, $4, $7, $2); |
962 } | 962 } |
963 ; | 963 ; |
964 | 964 |
1016 // Looping | 1016 // Looping |
1017 // ======= | 1017 // ======= |
1018 | 1018 |
1019 loop_command : WHILE stash_comment expression stmt_begin opt_sep opt_list END | 1019 loop_command : WHILE stash_comment expression stmt_begin opt_sep opt_list END |
1020 { | 1020 { |
1021 $3->mark_braindead_shortcircuit (lexer.fcn_file_full_name); | 1021 $3->mark_braindead_shortcircuit (); |
1022 | 1022 |
1023 if (! ($$ = parser.make_while_command ($1, $3, $6, $7, $2))) | 1023 if (! ($$ = parser.make_while_command ($1, $3, $6, $7, $2))) |
1024 { | 1024 { |
1025 // make_while_command deleted $3 and $6. | 1025 // make_while_command deleted $3 and $6. |
1026 ABORT_PARSE; | 1026 ABORT_PARSE; |