comparison 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
comparison
equal deleted inserted replaced
3882:c8c1ead8474f 3883:69b6bd271277
123 123
124 reset_parser (); 124 reset_parser ();
125 125
126 retval = yyparse (); 126 retval = yyparse ();
127 127
128 if (retval == 0 && global_command) 128 if (retval == 0)
129 { 129 {
130 global_command->eval (); 130 if (global_command)
131
132 delete global_command;
133
134 global_command = 0;
135
136 if (! (interactive || forced_interactive))
137 { 131 {
138 bool quit = (tree_return_command::returning 132 global_command->eval ();
139 || tree_break_command::breaking); 133
140 134 delete global_command;
141 if (tree_return_command::returning) 135
142 tree_return_command::returning = 0; 136 global_command = 0;
143 137
144 if (tree_break_command::breaking)
145 tree_break_command::breaking--;
146
147 if (quit)
148 break;
149 }
150
151 if (error_state)
152 {
153 if (! (interactive || forced_interactive)) 138 if (! (interactive || forced_interactive))
154 { 139 {
155 // We should exit with a non-zero status. 140 bool quit = (tree_return_command::returning
156 retval = 1; 141 || tree_break_command::breaking);
157 break; 142
143 if (tree_return_command::returning)
144 tree_return_command::returning = 0;
145
146 if (tree_break_command::breaking)
147 tree_break_command::breaking--;
148
149 if (quit)
150 break;
151 }
152
153 if (error_state)
154 {
155 if (! (interactive || forced_interactive))
156 {
157 // We should exit with a non-zero status.
158 retval = 1;
159 break;
160 }
161 }
162 else
163 {
164 if (octave_completion_matches_called)
165 octave_completion_matches_called = false;
166 else
167 command_editor::increment_current_command_number ();
158 } 168 }
159 } 169 }
160 else 170 else if (parser_end_of_input)
161 { 171 break;
162 if (octave_completion_matches_called)
163 octave_completion_matches_called = false;
164 else
165 command_editor::increment_current_command_number ();
166 }
167 } 172 }
168 else
169 break;
170 } 173 }
171 while (retval == 0); 174 while (retval == 0);
172 175
173 return retval; 176 return retval;
174 } 177 }