Mercurial > hg > octave-lyh
changeset 4237:9c8034434982
[project @ 2002-12-25 03:14:37 by jwe]
author | jwe |
---|---|
date | Wed, 25 Dec 2002 03:14:38 +0000 |
parents | a01ea6c855a3 |
children | a5a68c0afe56 |
files | src/ChangeLog src/lex.h src/lex.l src/parse.y |
diffstat | 4 files changed, 13 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2002-12-24 John W. Eaton <jwe@bevo.che.wisc.edu> + * parse.y (begin_obj_idx): Increment + lexer_flags.looking_at_object_index. + (postfix_expr): Decrement it as appropriate here. + * lex.h (lexical_feedback::looking_at_object_index): Now int. + * parse.y (postfix_expr): Reset lexer_flags.looking_at_object_index in () and {} cases too.
--- a/src/lex.h +++ b/src/lex.h @@ -162,8 +162,8 @@ // multi-value assignment statement. bool looking_at_matrix_or_assign_lhs; - // TRUE means we're parsing an indexing operation for an object. - bool looking_at_object_index; + // Nonzero means we're parsing an indexing operation for an object. + int looking_at_object_index; // GAG. Stupid kludge so that [[1,2][3,4]] will work. bool do_comma_insert;
--- a/src/lex.l +++ b/src/lex.l @@ -2546,7 +2546,7 @@ looking_at_matrix_or_assign_lhs = false; // Not parsing an object index. - looking_at_object_index = false; + looking_at_object_index = 0; // Next token can be identifier. cant_be_identifier = false;
--- a/src/parse.y +++ b/src/parse.y @@ -706,7 +706,7 @@ ; begin_obj_idx : // empty - { lexer_flags.looking_at_object_index = true; } + { lexer_flags.looking_at_object_index++; } ; postfix_expr : primary_expr @@ -714,22 +714,22 @@ | postfix_expr '(' begin_obj_idx ')' { $$ = make_index_expression ($1, 0, '('); - lexer_flags.looking_at_object_index = false; + lexer_flags.looking_at_object_index--; } | postfix_expr '(' begin_obj_idx arg_list ')' { $$ = make_index_expression ($1, $4, '('); - lexer_flags.looking_at_object_index = false; + lexer_flags.looking_at_object_index--; } | postfix_expr '{' begin_obj_idx '}' { $$ = make_index_expression ($1, 0, '{'); - lexer_flags.looking_at_object_index = false; + lexer_flags.looking_at_object_index--; } | postfix_expr '{' begin_obj_idx arg_list '}' { $$ = make_index_expression ($1, $4, '{'); - lexer_flags.looking_at_object_index = false; + lexer_flags.looking_at_object_index--; } | postfix_expr PLUS_PLUS { $$ = make_postfix_op (PLUS_PLUS, $1, $2); }