Mercurial > octave-nkf
diff libinterp/parse-tree/lex.ll @ 17355:f0edd6c752e9
don't convert "end" token to "__end__" for indexing
* lex.ll (octave_base_lexer::handle_identifier): Don't translate "end"
to "__end__".
* pt-arg-list.cc (Fend): Rename from F__end__.
* pt-id.h (tree_identifier::has_magic_end): Recognize "end" instead
of "__end__".
* pt-idx.cc: Refer to "end" in comment instead of "__end__".
* variables.cc (symbol_exist): Return early if keyword is found.
* resource-manager.cc (resource_manager::octave_keywords): Delete
__end__ from the list.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 28 Aug 2013 23:00:42 -0400 |
parents | 6470a113eae2 |
children | c702371ff6df efbe746f8fa8 |
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.ll Fri Aug 30 10:52:16 2013 -0400 +++ b/libinterp/parse-tree/lex.ll Wed Aug 28 23:00:42 2013 -0400 @@ -2723,11 +2723,7 @@ return kw_token; } - // Find the token in the symbol table. Beware the magic - // transformation of the end keyword... - - if (tok == "end") - tok = "__end__"; + // Find the token in the symbol table. symbol_table::scope_id sid = symtab_context.curr_scope (); @@ -2754,7 +2750,9 @@ current_input_column += flex_yyleng (); - if (tok != "__end__") + // The magic end index can't be indexed. + + if (tok != "end") looking_for_object_index = true; at_beginning_of_statement = false;