Mercurial > hg > octave-lyh
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 +++ b/src/ChangeLog @@ -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 +++ 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 == '=') {