Mercurial > hg > octave-nkf
diff src/lex.ll @ 13249:7861a5fd3479
accept enumeration keyword
* octave.gperf (octave_kw_id): New keyword ids, enumeration_kw and
endenumeration_kw.
(octave_kw): Add enumeration and endenumeration to the struct.
* lex.ll (is_keyword_token): Handle enumeration and endenumeration.
* oct-parse.yy (ENUMERATION): New token.
(enum_beg, enum_block, enum_list, class_enum): New non-terminals.
(class_body): Accept enum_block.
* token.h (token::enumeration_end): New end_tok_type enum value.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 29 Sep 2011 14:11:39 -0400 |
parents | 0c69a564f2be |
children | 28e3e9158d70 |
line wrap: on
line diff
--- a/src/lex.ll +++ b/src/lex.ll @@ -1541,6 +1541,11 @@ lexer_flags.at_beginning_of_statement = true; break; + case endenumeration_kw: + yylval.tok_val = new token (token::enumeration_end, l, c); + lexer_flags.at_beginning_of_statement = true; + break; + case endevents_kw: yylval.tok_val = new token (token::events_end, l, c); lexer_flags.at_beginning_of_statement = true; @@ -1589,9 +1594,10 @@ return 0; break; - case properties_kw: + case enumeration_kw: + case events_kw: case methods_kw: - case events_kw: + case properties_kw: // 'properties', 'methods' and 'events' are keywords for // classdef blocks. if (! lexer_flags.parsing_classdef)