# HG changeset patch # User John W. Eaton # Date 1244697199 -7200 # Node ID 52b9155fa58a069bde793e87ec156010bc8b40ce # Parent 796f31f0b1f5f7fbce25ade93f0d867087c53ca5 don't look for object index after keyword diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2009-06-10 John W. Eaton + + * 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 * octave.cc (octave_main): Call initialize_command_input diff --git a/src/lex.l b/src/lex.l --- 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; }