# HG changeset patch # User jwe # Date 1115703073 0 # Node ID 2781568bf95109ae93695ede19c39e5b2f6590d5 # Parent b427cca320b812596321fe6d34b4ca064e7ab018 [project @ 2005-05-10 05:31:12 by jwe] diff -r b427cca320b8 -r 2781568bf951 src/ChangeLog --- 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 + + * lex.l ({SNLCMT}*\]{S}*): If whitespace was gobbled, + unput SPC before returning the token. + ({SNLCMT}*\}{S}*): Likewise. + 2005-05-09 John W. Eaton * parse.y (except_command): Make catch clause optional in try diff -r b427cca320b8 -r 2781568bf951 src/lex.l --- 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); } {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 == '=') {