Mercurial > hg > octave-lyh
diff src/lex.l @ 4234:90e44267e8cf
[project @ 2002-12-21 17:15:25 by jwe]
author | jwe |
---|---|
date | Sat, 21 Dec 2002 17:15:25 +0000 |
parents | ccfdb55c8156 |
children | 9c8034434982 |
line wrap: on
line diff
--- a/src/lex.l +++ b/src/lex.l @@ -1108,7 +1108,10 @@ break; case end_kw: - yylval.tok_val = new token (token::simple_end, l, c); + if (lexer_flags.looking_at_object_index) + return 0; + else + yylval.tok_val = new token (token::simple_end, l, c); break; case end_try_catch_kw: @@ -2383,7 +2386,11 @@ } } - // Find the token in the symbol table. + // Find the token in the symbol table. Beware the magic + // transformation of the end keyword... + + if (tok == "end") + tok = "__end__"; yylval.tok_val = new token (lookup_identifier (tok), input_line_number, @@ -2538,6 +2545,9 @@ // assignment statement. looking_at_matrix_or_assign_lhs = false; + // Not parsing an object index. + looking_at_object_index = false; + // Next token can be identifier. cant_be_identifier = false;