diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2016-12-19 15:52:04 -0700 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2016-12-19 15:52:04 -0700 |
| commit | 0580d6a85fda454b05620aa4415a53f3dbcd3475 (patch) | |
| tree | ef257f03b3c395f7eb2177177bbafef9e5de8265 /src/parser.cpp | |
| parent | f7035d970fc629e3e95f03dd5f4e9618cb3230d7 (diff) | |
| download | clic-newparser.tar.gz clic-newparser.tar.bz2 clic-newparser.tar.xz clic-newparser.zip | |
It actually sorta' works again!newparser
Diffstat (limited to 'src/parser.cpp')
| -rw-r--r-- | src/parser.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index c83c156..cdb1064 100644 --- a/src/parser.cpp +++ b/src/parser.cpp | |||
| @@ -26,6 +26,8 @@ Parser::~Parser() | |||
| 26 | 26 | ||
| 27 | Expression *Parser::parse() | 27 | Expression *Parser::parse() |
| 28 | { | 28 | { |
| 29 | while( lex[0].eType == Token::tEndOfLine ) | ||
| 30 | lex.nextToken(); | ||
| 29 | pCurExp = new Expression(); | 31 | pCurExp = new Expression(); |
| 30 | statement(); | 32 | statement(); |
| 31 | while( !tsTerminal.isEmpty() ) | 33 | while( !tsTerminal.isEmpty() ) |
| @@ -33,6 +35,9 @@ Expression *Parser::parse() | |||
| 33 | reduce(); | 35 | reduce(); |
| 34 | } | 36 | } |
| 35 | 37 | ||
| 38 | if( lex[0].eType == Token::tEndOfLine ) | ||
| 39 | lex.nextToken(); | ||
| 40 | |||
| 36 | printState("Final"); | 41 | printState("Final"); |
| 37 | 42 | ||
| 38 | tsTerminal.clear(); | 43 | tsTerminal.clear(); |
| @@ -247,6 +252,7 @@ void Parser::statement() | |||
| 247 | break; | 252 | break; |
| 248 | } | 253 | } |
| 249 | lex.setMode( Lexer::modeNormal ); | 254 | lex.setMode( Lexer::modeNormal ); |
| 255 | lex.nextToken(); | ||
| 250 | } | 256 | } |
| 251 | else | 257 | else |
| 252 | { | 258 | { |
