Mercurial > hg > octave-lyh
changeset 11983:52b9155fa58a release-3-2-x
don't look for object index after keyword
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 11 Jun 2009 07:13:19 +0200 |
parents | 796f31f0b1f5 |
children | b4986fecdc53 |
files | src/ChangeLog src/lex.l |
diffstat | 2 files changed, 13 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2009-06-10 John W. Eaton <jwe@octave.org> + + * lex.l (handle_identifier): Set lexer_flags.looking_for_object_index + false if identifier is a keyword. + ({IDENT}{S}*): Don't set lexer_flags.looking_for_object_index here. + 2009-06-09 Jaroslav Hajek <highegg@gmail.com> * octave.cc (octave_main): Call initialize_command_input
--- a/src/lex.l +++ b/src/lex.l @@ -723,11 +723,7 @@ int id_tok = handle_identifier (); if (id_tok >= 0) - { - lexer_flags.looking_for_object_index = true; - - COUNT_TOK_AND_RETURN (id_tok); - } + COUNT_TOK_AND_RETURN (id_tok); } %{ @@ -3104,6 +3100,7 @@ lexer_flags.quote_is_transpose = true; lexer_flags.convert_spaces_to_comma = true; + lexer_flags.looking_for_object_index = true; current_input_column += yyleng; @@ -3141,6 +3138,7 @@ current_input_column += yyleng; lexer_flags.quote_is_transpose = false; lexer_flags.convert_spaces_to_comma = true; + lexer_flags.looking_for_object_index = true; return FCN_HANDLE; } @@ -3156,6 +3154,7 @@ current_input_column += yyleng; lexer_flags.quote_is_transpose = false; lexer_flags.convert_spaces_to_comma = true; + lexer_flags.looking_for_object_index = false; } return kw_token; @@ -3234,6 +3233,9 @@ current_input_column += yyleng; + if (tok != "__end__") + lexer_flags.looking_for_object_index = true; + return NAME; }