Mercurial > hg > octave-nkf
diff libinterp/parse-tree/lex.h @ 16265:71ee3afedb69
5/10 commits reworking the lexer
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 11 Mar 2013 14:29:19 -0400 |
parents | 9acb86e6ac90 |
children | 36e01847694f 15f55df088e7 |
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.h +++ b/libinterp/parse-tree/lex.h @@ -73,7 +73,8 @@ { BRACKET = 1, BRACE = 2, - PAREN = 3 + PAREN = 3, + ANON_FCN_BODY = 4 }; public: @@ -119,6 +120,13 @@ return ! context.empty () && context.top () == PAREN; } + void anon_fcn_body (void) { context.push (ANON_FCN_BODY); } + + bool is_anon_fcn_body (void) + { + return ! context.empty () && context.top () == ANON_FCN_BODY; + } + bool is_bracket_or_brace (void) { return (! context.empty () @@ -385,8 +393,8 @@ // set of identifiers that might be local variable names. std::set<std::string> pending_local_variables; - // is the closest nesting level a square bracket, squiggly brace or - // a paren? + // is the closest nesting level a square bracket, squiggly brace, + // a paren, or an anonymous function body? bbp_nesting_level nesting_level; // Tokens generated by the lexer.