diff libinterp/parse-tree/oct-parse.in.yy @ 16212:d2b268936783 classdef

maint: periodic merge of default to classdef
author John W. Eaton <jwe@octave.org>
date Thu, 07 Mar 2013 10:25:39 -0500 (2013-03-07)
parents 3449bf257514 78365c56a762
children 90dfd98a915a
line wrap: on
line diff
--- a/libinterp/parse-tree/oct-parse.in.yy
+++ b/libinterp/parse-tree/oct-parse.in.yy
@@ -97,10 +97,6 @@
 #define malloc GNULIB_NAMESPACE::malloc
 #endif
 
-// TRUE means we are using readline.
-// (--no-line-editing)
-bool line_editing = true;
-
 // TRUE means we printed messages about reading startup files.
 bool reading_startup_message_printed = false;
 
@@ -344,7 +340,6 @@
 input           : input1
                   {
                     curr_parser.stmt_list = $1;
-                    promptflag = 1;
                     YYACCEPT;
                   }
                 | simple_list parse_error
@@ -3366,16 +3361,18 @@
 
   output_buf << "\n\n";
 
-  if (! current_input_line.empty ())
+  std::string curr_line = curr_lexer->current_input_line;
+
+  if (! curr_line.empty ())
     {
-      size_t len = current_input_line.length ();
-
-      if (current_input_line[len-1] == '\n')
-        current_input_line.resize (len-1);
+      size_t len = curr_line.length ();
+
+      if (curr_line[len-1] == '\n')
+        curr_line.resize (len-1);
 
       // Print the line, maybe with a pointer near the error token.
 
-      output_buf << ">>> " << current_input_line << "\n";
+      output_buf << ">>> " << curr_line << "\n";
 
       if (err_col == 0)
         err_col = len;
@@ -3425,10 +3422,6 @@
 
   frame.add_fcn (command_editor::set_input_stream, in_stream);
 
-  frame.protect_var (line_editing);
-
-  line_editing = false;
-
   frame.add_fcn (command_history::ignore_entries,
                  command_history::ignoring_entries ());
 
@@ -4167,10 +4160,6 @@
 
   octave_parser curr_parser (eval_str);
 
-  frame.protect_var (line_editing);
-
-  line_editing = false;
-
   do
     {
       curr_parser.reset ();