From 7ed0e4a720979841294f638e69b11d39e790855f Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Sat, 22 Jun 2013 17:35:09 +0000 Subject: [PATCH] more changes --- std/d/parser.d | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/std/d/parser.d b/std/d/parser.d index 956ba5b..83f5f29 100755 --- a/std/d/parser.d +++ b/std/d/parser.d @@ -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; }