Mercurial > hg > octave-nkf
changeset 13250:f6bbdea030b2
use opt_sep instead of literal '\n' in parser rules for classdef
* oct-parse.yy (class_def, class_body, properties_block,
properties_list, methods_block, methods_list, events_block,
events_list, enum_block, enum_list): Accept opt_sep instead of literal
newline character.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 29 Sep 2011 14:16:58 -0400 |
parents | 7861a5fd3479 |
children | e0ef7a3f35d9 |
files | src/oct-parse.yy |
diffstat | 1 files changed, 13 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/src/oct-parse.yy +++ b/src/oct-parse.yy @@ -1491,7 +1491,7 @@ { $$ = 0; } ; -classdef : classdef1 '\n' class_body '\n' stash_comment classdef_end +classdef : classdef1 opt_sep class_body opt_sep stash_comment classdef_end { $$ = 0; } ; @@ -1540,13 +1540,13 @@ { $$ = 0; } | enum_block { $$ = 0; } - | class_body '\n' properties_block + | class_body opt_sep properties_block { $$ = 0; } - | class_body '\n' methods_block + | class_body opt_sep methods_block { $$ = 0; } - | class_body '\n' events_block + | class_body opt_sep events_block { $$ = 0; } - | class_body '\n' enum_block + | class_body opt_sep enum_block { $$ = 0; } ; @@ -1555,14 +1555,14 @@ ; properties_block - : properties_beg opt_attr_list '\n' properties_list '\n' END + : properties_beg opt_attr_list opt_sep properties_list opt_sep END { $$ = 0; } ; properties_list : class_property { $$ = 0; } - | properties_list '\n' class_property + | properties_list opt_sep class_property { $$ = 0; } ; @@ -1576,13 +1576,13 @@ { $$ = 0; } ; -methods_block : methods_beg opt_attr_list '\n' methods_list '\n' END +methods_block : methods_beg opt_attr_list opt_sep methods_list opt_sep END { $$ = 0; } ; methods_list : function { $$ = 0; } - | methods_list '\n' function + | methods_list opt_sep function { $$ = 0; } ; @@ -1590,13 +1590,13 @@ { $$ = 0; } ; -events_block : events_beg opt_attr_list '\n' events_list '\n' END +events_block : events_beg opt_attr_list opt_sep events_list opt_sep END { $$ = 0; } ; events_list : class_event { $$ = 0; } - | events_list '\n' class_event + | events_list opt_sep class_event { $$ = 0; } ; @@ -1608,13 +1608,13 @@ { $$ = 0; } ; -enum_block : enum_beg opt_attr_list '\n' enum_list '\n' END +enum_block : enum_beg opt_attr_list opt_sep enum_list opt_sep END { $$ = 0; } ; enum_list : class_enum { $$ = 0; } - | enum_list '\n' class_enum + | enum_list opt_sep class_enum { $$ = 0; } ;