comparison src/parse.y @ 3489:cbee5fbb696d

[project @ 2000-01-28 09:14:32 by jwe]
author jwe
date Fri, 28 Jan 2000 09:14:34 +0000
parents e5d5848370c9
children b80bbb43a1a9
comparison
equal deleted inserted replaced
3488:85c0ebb78d1e 3489:cbee5fbb696d
114 bool input_from_startup_file = false; 114 bool input_from_startup_file = false;
115 115
116 // TRUE means that input is coming from a file that was named on 116 // TRUE means that input is coming from a file that was named on
117 // the command line. 117 // the command line.
118 bool input_from_command_line_file = true; 118 bool input_from_command_line_file = true;
119
120 // TRUE means that we are in the process of evaluating a function
121 // body. The parser might be called in that case if we are looking at
122 // an eval() statement.
123 bool evaluating_function_body = false;
119 124
120 // Forward declarations for some functions defined at the bottom of 125 // Forward declarations for some functions defined at the bottom of
121 // the file. 126 // the file.
122 127
123 // Generic error messages. 128 // Generic error messages.
1615 1620
1616 if (op1->is_constant () && op2->is_constant ()) 1621 if (op1->is_constant () && op2->is_constant ())
1617 { 1622 {
1618 octave_value tmp = e->rvalue (); 1623 octave_value tmp = e->rvalue ();
1619 1624
1620 if (! error_state) 1625 if (! (error_state || warning_state))
1621 { 1626 {
1622 tree_constant *tc_retval = new tree_constant (tmp); 1627 tree_constant *tc_retval = new tree_constant (tmp);
1623 1628
1624 ostrstream buf; 1629 ostrstream buf;
1625 1630
1664 1669
1665 if (op->is_constant ()) 1670 if (op->is_constant ())
1666 { 1671 {
1667 octave_value tmp = e->rvalue (); 1672 octave_value tmp = e->rvalue ();
1668 1673
1669 if (! error_state) 1674 if (! (error_state || warning_state))
1670 { 1675 {
1671 tree_constant *tc_retval = new tree_constant (tmp); 1676 tree_constant *tc_retval = new tree_constant (tmp);
1672 1677
1673 ostrstream buf; 1678 ostrstream buf;
1674 1679
1722 if (base->is_constant () && limit->is_constant () 1727 if (base->is_constant () && limit->is_constant ()
1723 && (! incr || (incr && incr->is_constant ()))) 1728 && (! incr || (incr && incr->is_constant ())))
1724 { 1729 {
1725 octave_value tmp = e->rvalue (); 1730 octave_value tmp = e->rvalue ();
1726 1731
1727 if (! error_state) 1732 if (! (error_state || warning_state))
1728 { 1733 {
1729 tree_constant *tc_retval = new tree_constant (tmp); 1734 tree_constant *tc_retval = new tree_constant (tmp);
1730 1735
1731 ostrstream buf; 1736 ostrstream buf;
1732 1737
2141 tree_command *retval = 0; 2146 tree_command *retval = 0;
2142 2147
2143 int l = break_tok->line (); 2148 int l = break_tok->line ();
2144 int c = break_tok->column (); 2149 int c = break_tok->column ();
2145 2150
2146 if (lexer_flags.looping || lexer_flags.defining_func || reading_script_file) 2151 if (lexer_flags.looping || lexer_flags.defining_func
2152 || reading_script_file || evaluating_function_body)
2147 retval = new tree_break_command (l, c); 2153 retval = new tree_break_command (l, c);
2148 else 2154 else
2149 retval = new tree_no_op_command ("break", l, c); 2155 retval = new tree_no_op_command ("break", l, c);
2150 2156
2151 return retval; 2157 return retval;
2177 tree_command *retval = 0; 2183 tree_command *retval = 0;
2178 2184
2179 int l = return_tok->line (); 2185 int l = return_tok->line ();
2180 int c = return_tok->column (); 2186 int c = return_tok->column ();
2181 2187
2182 if (lexer_flags.defining_func || reading_script_file) 2188 if (lexer_flags.defining_func || reading_script_file
2189 || evaluating_function_body)
2183 retval = new tree_return_command (l, c); 2190 retval = new tree_return_command (l, c);
2184 else 2191 else
2185 retval = new tree_no_op_command ("return", l, c); 2192 retval = new tree_no_op_command ("return", l, c);
2186 2193
2187 return retval; 2194 return retval;
2552 2559
2553 if (m->all_elements_are_constant ()) 2560 if (m->all_elements_are_constant ())
2554 { 2561 {
2555 octave_value tmp = m->rvalue (); 2562 octave_value tmp = m->rvalue ();
2556 2563
2557 if (! error_state) 2564 if (! (error_state || warning_state))
2558 { 2565 {
2559 tree_constant *tc_retval = new tree_constant (tmp); 2566 tree_constant *tc_retval = new tree_constant (tmp);
2560 2567
2561 ostrstream buf; 2568 ostrstream buf;
2562 2569