changeset 5345:2781568bf951

[project @ 2005-05-10 05:31:12 by jwe]
author jwe
date Tue, 10 May 2005 05:31:13 +0000
parents b427cca320b8
children a103c41e68b2
files src/ChangeLog src/lex.l
diffstat 2 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon May 09 19:03:03 2005 +0000
+++ b/src/ChangeLog	Tue May 10 05:31:13 2005 +0000
@@ -1,3 +1,9 @@
+2005-05-10  John W. Eaton  <jwe@octave.org>
+
+	* lex.l (<MATRIX_START>{SNLCMT}*\]{S}*): If whitespace was gobbled,
+	unput SPC before returning the token.
+	(<MATRIX_START>{SNLCMT}*\}{S}*): Likewise.
+
 2005-05-09  John W. Eaton  <jwe@octave.org>
 
 	* parse.y (except_command): Make catch clause optional in try
--- a/src/lex.l	Mon May 09 19:03:03 2005 +0000
+++ b/src/lex.l	Tue May 10 05:31:13 2005 +0000
@@ -360,7 +360,10 @@
     int c = yytext[yyleng-1];
     int cont_is_spc = eat_continuation ();
     bool spc_gobbled = (cont_is_spc || c == ' ' || c == '\t');
-    COUNT_TOK_AND_RETURN (handle_close_bracket (spc_gobbled, ']'));
+    int tok_to_return = handle_close_bracket (spc_gobbled, ']');
+    if (spc_gobbled)
+      yyunput (' ', yytext);
+    COUNT_TOK_AND_RETURN (tok_to_return);
   }
 
 <MATRIX_START>{SNLCMT}*\}{S}* {
@@ -369,7 +372,10 @@
     int c = yytext[yyleng-1];
     int cont_is_spc = eat_continuation ();
     bool spc_gobbled = (cont_is_spc || c == ' ' || c == '\t');
-    COUNT_TOK_AND_RETURN (handle_close_bracket (spc_gobbled, '}'));
+    int tok_to_return = handle_close_bracket (spc_gobbled, '}');
+    if (spc_gobbled)
+      yyunput (' ', yytext);
+    COUNT_TOK_AND_RETURN (tok_to_return);
   }
 
 %{
@@ -2289,6 +2295,8 @@
 
   bool next_tok_is_paren = (c1 == '(');
 
+  bool next_tok_is_struct_ref = (c1 == '.');
+
   bool next_tok_is_eq = false;
   if (c1 == '=')
     {