Mercurial > hg > octave-lojdl
changeset 16251:37af399267b2
undo previous change to add optional semicolon non-terminal in the parser
* oct-parse.in.yy (opt_semi): Delete non-terminal and all uses.
(cell_or_matrix_row): Don't use opt_comma here.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 10 Mar 2013 00:37:06 -0500 |
parents | b1b01c69967e |
children | 6a3c6c921daa a89cf57ba3a5 |
files | libinterp/parse-tree/oct-parse.in.yy |
diffstat | 1 files changed, 10 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/parse-tree/oct-parse.in.yy +++ b/libinterp/parse-tree/oct-parse.in.yy @@ -235,8 +235,7 @@ // Nonterminals we construct. %type <comment_type> stash_comment function_beg classdef_beg %type <comment_type> properties_beg methods_beg events_beg enum_beg -%type <sep_type> sep_no_nl opt_sep_no_nl nl opt_nl sep opt_sep -%type <sep_type> opt_comma opt_semi +%type <sep_type> sep_no_nl opt_sep_no_nl nl opt_nl sep opt_sep opt_comma %type <tree_type> input %type <tree_constant_type> string constant magic_colon %type <tree_anon_fcn_handle_type> anon_fcn_handle @@ -454,7 +453,9 @@ } ; -matrix_rows : matrix_rows1 opt_semi +matrix_rows : matrix_rows1 + { $$ = $1; } + | matrix_rows1 ';' // Ignore trailing semicolon. { $$ = $1; } ; @@ -475,7 +476,9 @@ { $$ = curr_parser.finish_cell ($2); } ; -cell_rows : cell_rows1 opt_semi +cell_rows : cell_rows1 + { $$ = $1; } + | cell_rows1 ';' // Ignore trailing semicolon. { $$ = $1; } ; @@ -489,7 +492,9 @@ ; cell_or_matrix_row - : arg_list opt_comma + : arg_list + { $$ = curr_parser.validate_matrix_row ($1); } + | arg_list ',' // Ignore trailing comma. { $$ = curr_parser.validate_matrix_row ($1); } ; @@ -1453,12 +1458,6 @@ { $$ = ','; } ; -opt_semi : // empty - { $$ = 0; } - | ';' - { $$ = ';'; } - ; - %% // Generic error messages.