diff 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
line wrap: on
line diff
--- a/src/parse.y	Fri Jan 28 06:47:58 2000 +0000
+++ b/src/parse.y	Fri Jan 28 09:14:34 2000 +0000
@@ -117,6 +117,11 @@
 // the command line.
 bool input_from_command_line_file = true;
 
+// TRUE means that we are in the process of evaluating a function
+// body.  The parser might be called in that case if we are looking at
+// an eval() statement.
+bool evaluating_function_body = false;
+
 // Forward declarations for some functions defined at the bottom of
 // the file.
 
@@ -1617,7 +1622,7 @@
     {
       octave_value tmp = e->rvalue ();
 
-      if (! error_state)
+      if (! (error_state || warning_state))
 	{
 	  tree_constant *tc_retval = new tree_constant (tmp);
 
@@ -1666,7 +1671,7 @@
     {
       octave_value tmp = e->rvalue ();
 
-      if (! error_state)
+      if (! (error_state || warning_state))
 	{
 	  tree_constant *tc_retval = new tree_constant (tmp);
 
@@ -1724,7 +1729,7 @@
 	    {
 	      octave_value tmp = e->rvalue ();
 
-	      if (! error_state)
+	      if (! (error_state || warning_state))
 		{
 		  tree_constant *tc_retval = new tree_constant (tmp);
 
@@ -2143,7 +2148,8 @@
   int l = break_tok->line ();
   int c = break_tok->column ();
 
-  if (lexer_flags.looping || lexer_flags.defining_func || reading_script_file)
+  if (lexer_flags.looping || lexer_flags.defining_func
+      || reading_script_file || evaluating_function_body)
     retval = new tree_break_command (l, c);
   else
     retval = new tree_no_op_command ("break", l, c);
@@ -2179,7 +2185,8 @@
   int l = return_tok->line ();
   int c = return_tok->column ();
 
-  if (lexer_flags.defining_func || reading_script_file)
+  if (lexer_flags.defining_func || reading_script_file
+      || evaluating_function_body)
     retval = new tree_return_command (l, c);
   else
     retval = new tree_no_op_command ("return", l, c);
@@ -2554,7 +2561,7 @@
     {
       octave_value tmp = m->rvalue ();
 
-      if (! error_state)
+      if (! (error_state || warning_state))
 	{
 	  tree_constant *tc_retval = new tree_constant (tmp);