summaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2016-12-19 15:52:04 -0700
committerMike Buland <eichlan@xagasoft.com>2016-12-19 15:52:04 -0700
commit0580d6a85fda454b05620aa4415a53f3dbcd3475 (patch)
treeef257f03b3c395f7eb2177177bbafef9e5de8265 /src/parser.cpp
parentf7035d970fc629e3e95f03dd5f4e9618cb3230d7 (diff)
downloadclic-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.cpp6
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
27Expression *Parser::parse() 27Expression *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 {