diff libinterp/parse-tree/oct-parse.in.yy @ 16207:0467d68ca891

move current_input_line to lexical_feedback class * input.h, input.cc, lex.h, lex.ll (current_input_line): Declare as member of lexical_feedback class. (octave_base_reader::octave_gets, octave_terminal_reader::get_input, octave_file_reader::get_input, octave_eval_string_reader::get_input): Don't set current_input_line. (octave_lexer::read): Set current_input_line. * oct-parse.in.yy (octave_parser::bison_error): Use curr_lexer->current_input_line.
author John W. Eaton <jwe@octave.org>
date Wed, 06 Mar 2013 19:39:48 -0500
parents 127cccb037bf
children e7ff32e7cf82
line wrap: on
line diff
--- a/libinterp/parse-tree/oct-parse.in.yy	Wed Mar 06 15:10:22 2013 -0800
+++ b/libinterp/parse-tree/oct-parse.in.yy	Wed Mar 06 19:39:48 2013 -0500
@@ -3101,16 +3101,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;