# HG changeset patch # User jwe # Date 785524332 0 # Node ID 570f55edf65f08736d2cbf0362a03919f35ed5cc # Parent 91edf12ce30b0e57b74932339a6fbbf25c7c6f92 [project @ 1994-11-22 17:12:12 by jwe] diff -r 91edf12ce30b -r 570f55edf65f src/lex.l --- a/src/lex.l Mon Nov 21 22:08:36 1994 +0000 +++ b/src/lex.l Tue Nov 22 17:12:12 1994 +0000 @@ -164,6 +164,8 @@ } } +{S}* { current_input_column += yyleng; } + [^ \t\n]*{S}* | [^ \t\n\;\,]*{S}* { static char *tok = 0; @@ -220,8 +222,6 @@ return TEXT; } -{S}* { current_input_column += yyleng; } - {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 @@ } {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 (','); diff -r 91edf12ce30b -r 570f55edf65f src/parse.y --- a/src/parse.y Mon Nov 21 22:08:36 1994 +0000 +++ b/src/parse.y Tue Nov 22 17:12:12 1994 +0000 @@ -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)