Mercurial > hg > octave-max
changeset 947:570f55edf65f
[project @ 1994-11-22 17:12:12 by jwe]
author | jwe |
---|---|
date | Tue, 22 Nov 1994 17:12:12 +0000 |
parents | 91edf12ce30b |
children | 270669e9ee93 |
files | src/lex.l src/parse.y |
diffstat | 2 files changed, 31 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lex.l +++ b/src/lex.l @@ -164,6 +164,8 @@ } } +<TEXT_FCN>{S}* { current_input_column += yyleng; } + <HELP_FCN>[^ \t\n]*{S}* | <TEXT_FCN>[^ \t\n\;\,]*{S}* { static char *tok = 0; @@ -220,8 +222,6 @@ return TEXT; } -<TEXT_FCN>{S}* { current_input_column += yyleng; } - <STRING>{QSTR}*[\n\'] { if (braceflag) BEGIN MATRIX; @@ -296,8 +296,12 @@ // different for the expression on the left hand side of the equals // operator. - in_brace_or_paren.pop (); - braceflag--; + if (! in_brace_or_paren.empty ()) + { + in_brace_or_paren.pop (); + braceflag--; + } + if (braceflag == 0) { if (! defining_func) @@ -312,8 +316,12 @@ } <MATRIX>{SN}*\]{S}*/= { - in_brace_or_paren.pop (); - braceflag--; + if (! in_brace_or_paren.empty ()) + { + in_brace_or_paren.pop (); + braceflag--; + } + if (braceflag == 0) { BEGIN 0; @@ -336,8 +344,12 @@ // It's a pain in the ass to decide whether to insert a comma after // seeing a ']' character... - in_brace_or_paren.pop (); - braceflag--; + if (! in_brace_or_paren.empty ()) + { + in_brace_or_paren.pop (); + braceflag--; + } + if (braceflag == 0) { if (! defining_func) @@ -358,9 +370,12 @@ unput (c1); int other_op = match_any (c1, ",;\n]"); - if (! (postfix_un_op || bin_op || other_op) - && in_brace_or_paren.top () - && convert_spaces_to_comma) + if (! (postfix_un_op + || bin_op + || other_op + || in_brace_or_paren.empty ()) + && in_brace_or_paren.top () + && convert_spaces_to_comma) { unput (','); return ']'; @@ -385,7 +400,9 @@ int postfix_un_op = next_token_is_postfix_unary_op (1, yytext); - if (! (postfix_un_op || bin_op) + if (! (postfix_un_op + || bin_op + || in_brace_or_paren.empty ()) && in_brace_or_paren.top () && convert_spaces_to_comma) TOK_RETURN (',');
--- a/src/parse.y +++ b/src/parse.y @@ -1573,7 +1573,8 @@ if (list_len == 1) { tree_index_expression *lhs = id_list->remove_front (); - retval = new tree_simple_assignment_expression (lhs, rhs, l, c); + retval = new tree_simple_assignment_expression (lhs, rhs, + 0, 0, l, c); } else if (list_len > 1)