diff src/lex.l @ 3805:44386b0e53da

[project @ 2001-03-01 16:54:31 by jwe]
author jwe
date Thu, 01 Mar 2001 16:54:33 +0000
parents 4f1a26a730fd
children 8986086e3e0f
line wrap: on
line diff
--- a/src/lex.l	Wed Feb 28 08:38:39 2001 +0000
+++ b/src/lex.l	Thu Mar 01 16:54:33 2001 +0000
@@ -990,6 +990,9 @@
 static int
 is_keyword (const std::string& s)
 {
+  int l = input_line_number;
+  int c = current_input_column;
+
   if (lexer_flags.plotting)
     {
       if (lexer_flags.in_plot_style)
@@ -999,7 +1002,7 @@
 	  if (! sty.empty ())
 	    {
 	      lexer_flags.in_plot_style = false;
-	      yylval.tok_val = new token (sty);
+	      yylval.tok_val = new token (sty, l, c);
 	      token_stack.push (yylval.tok_val);
 	      return STYLE;
 	    }
@@ -1011,16 +1014,13 @@
 	  if (! axes.empty ())
 	    {
 	      lexer_flags.in_plot_axes = false;
-	      yylval.tok_val = new token (axes);
+	      yylval.tok_val = new token (axes, l, c);
 	      token_stack.push (yylval.tok_val);
 	      return AXES_TAG;
 	    }
 	}	
     }
 
-  int l = input_line_number;
-  int c = current_input_column;
-
   int len = s.length ();
 
   const octave_kw *kw = octave_kw_lookup (s.c_str (), len);
@@ -1885,6 +1885,9 @@
 {
   std::ostrstream buf;
 
+  int bos_line = input_line_number;
+  int bos_col = current_input_column;
+
   int c;
   int escape_pending = 0;
 
@@ -1949,7 +1952,7 @@
 		      lexer_flags.convert_spaces_to_comma = true;
 		    }
 
-		  yylval.tok_val = new token (s);
+		  yylval.tok_val = new token (s, bos_line, bos_col);
 		  token_stack.push (yylval.tok_val);
 
 		  if (delim == '\'')