changeset 3880:c21ae2c5840f

[project @ 2002-03-26 02:23:06 by jwe]
author jwe
date Tue, 26 Mar 2002 02:23:06 +0000
parents 7200bfd25c97
children c34d631dee18
files src/ChangeLog src/lex.l src/parse.y
diffstat 3 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Mar 08 21:02:33 2002 +0000
+++ b/src/ChangeLog	Tue Mar 26 02:23:06 2002 +0000
@@ -1,3 +1,11 @@
+2002-03-25  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* parse.y (parse_fcn_file): Call error if there is no input file.
+	(parse_and_execute (FILE *): Protect get_input_from_eval_string.
+	Set get_input_from_eval_string to false before calling yyparse.
+	* lex.l (reset_parser): Also skip yyrestart (stdin) if
+	reading_script_file is true.
+
 2002-03-07  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* pt-loop.cc (evaluating_looping_command): New global.
--- a/src/lex.l	Fri Mar 08 21:02:33 2002 +0000
+++ b/src/lex.l	Tue Mar 26 02:23:06 2002 +0000
@@ -783,7 +783,9 @@
   // Only ask for input from stdin if we are expecting interactive
   // input.
   if ((interactive || forced_interactive)
-      && ! (reading_fcn_file || get_input_from_eval_string
+      && ! (reading_fcn_file
+	    || reading_script_file
+	    || get_input_from_eval_string
 	    || input_from_startup_file))
     yyrestart (stdin);
 
--- a/src/parse.y	Fri Mar 08 21:02:33 2002 +0000
+++ b/src/parse.y	Tue Mar 26 02:23:06 2002 +0000
@@ -2720,7 +2720,7 @@
 parse_and_execute (FILE *f)
 {
   unwind_protect::begin_frame ("parse_and_execute");
-  
+
   YY_BUFFER_STATE old_buf = current_buffer ();
   YY_BUFFER_STATE new_buf = create_buffer (f);
 
@@ -2731,9 +2731,11 @@
 
   unwind_protect_bool (line_editing);
   unwind_protect_bool (input_from_command_line_file);
+  unwind_protect_bool (get_input_from_eval_string);
 
   line_editing = false;
   input_from_command_line_file = false;
+  get_input_from_eval_string = false;
 
   unwind_protect_ptr (curr_sym_tab);
 
@@ -3200,6 +3202,8 @@
 	  script_file_executed = true;
 	}
     }
+  else
+    error ("no such file, `%s'", ff.c_str ());
 
   unwind_protect::run_frame ("parse_fcn_file");