diff src/lex.l @ 5345:2781568bf951

[project @ 2005-05-10 05:31:12 by jwe]
author jwe
date Tue, 10 May 2005 05:31:13 +0000
parents 4c8a2e4e0717
children e965ab89f832
line wrap: on
line diff
--- a/src/lex.l
+++ b/src/lex.l
@@ -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 == '=')
     {