more changes

This commit is contained in:
Hackerpilot 2013-06-22 17:35:09 +00:00
parent 3a66f01405
commit 7ed0e4a720
1 changed files with 12 additions and 8 deletions

View File

@ -73,10 +73,10 @@ version = development;
version(development) import std.stdio;
/**
* Params:
* tokens = the tokens parsed by std.d.lexer
* Returns: the parsed module
*/
* Params:
* tokens = the tokens parsed by std.d.lexer
* Returns: the parsed module
*/
Module parseModule(const(Token)[] tokens)
{
auto parser = new Parser();
@ -657,15 +657,19 @@ struct Parser
* Parses an AssignStatement
*
* $(GRAMMAR $(RULEDEF assignStatement):
* $(RULE unaryExpression) $(RULE assignOperator) $(RULE assignExpression) ($(LITERAL ',') $(RULE unaryExpression) $(RULE assignOperator) $(RULE assignExpression))* $(LITERAL ';')
* | $(RULE preIncDecExpression) $(LITERAL ';')
* | $(RULE postIncDecExpression) $(LITERAL ';')
* $(RULE assignExpression) $(LITERAL ';')
* ;)
*/
AssignStatement parseAssignStatement()
{
auto node = new AssignStatement;
// TODO
if (currentIsOneOf(TokenType.increment, TokenType.decrement))
node.preIncDecExpression = parsePreIncDecExpression();
else
{
// TODO
}
expect(TokenType.semicolon);
return node;
}