diff src/toplev.cc @ 3883:69b6bd271277

[project @ 2002-04-02 21:05:10 by jwe]
author jwe
date Tue, 02 Apr 2002 21:05:10 +0000
parents c34d631dee18
children 7da18459c08b
line wrap: on
line diff
--- a/src/toplev.cc
+++ b/src/toplev.cc
@@ -125,48 +125,51 @@
 
       retval = yyparse ();
 
-      if (retval == 0 && global_command)
+      if (retval == 0)
 	{
-	  global_command->eval ();
-
-	  delete global_command;
-
-	  global_command = 0;
-
-	  if (! (interactive || forced_interactive))
+	  if (global_command)
 	    {
-	      bool quit = (tree_return_command::returning
-			   || tree_break_command::breaking);
+	      global_command->eval ();
 
-	      if (tree_return_command::returning)
-		tree_return_command::returning = 0;
-
-	      if (tree_break_command::breaking)
-		tree_break_command::breaking--;
+	      delete global_command;
 
-	      if (quit)
-		break;
-	    }
+	      global_command = 0;
 
-	  if (error_state)
-	    {
 	      if (! (interactive || forced_interactive))
 		{
-		  // We should exit with a non-zero status.
-		  retval = 1;
-		  break;
+		  bool quit = (tree_return_command::returning
+			       || tree_break_command::breaking);
+
+		  if (tree_return_command::returning)
+		    tree_return_command::returning = 0;
+
+		  if (tree_break_command::breaking)
+		    tree_break_command::breaking--;
+
+		  if (quit)
+		    break;
+		}
+
+	      if (error_state)
+		{
+		  if (! (interactive || forced_interactive))
+		    {
+		      // We should exit with a non-zero status.
+		      retval = 1;
+		      break;
+		    }
+		}
+	      else
+		{
+		  if (octave_completion_matches_called)
+		    octave_completion_matches_called = false;	    
+		  else
+		    command_editor::increment_current_command_number ();
 		}
 	    }
-	  else
-	    {
-	      if (octave_completion_matches_called)
-		octave_completion_matches_called = false;	    
-	      else
-		command_editor::increment_current_command_number ();
-	    }
+	  else if (parser_end_of_input)
+	    break;
 	}
-      else
-	break;
     }
   while (retval == 0);