diff options
Diffstat (limited to '')
-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 | { |