From ebbb1907d197bed6f1547a50b7462b5382ff8ec9 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Tue, 10 Sep 2013 22:46:39 -0700 Subject: [PATCH] Fixed problem in startsWith. Fixed grammar error --- stdx/d/parser.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdx/d/parser.d b/stdx/d/parser.d index 6f80dff..9c6a0f3 100644 --- a/stdx/d/parser.d +++ b/stdx/d/parser.d @@ -111,7 +111,7 @@ struct Parser * Parses an AliasDeclaration. * * $(GRAMMAR $(RULEDEF aliasDeclaration): - * $(LITERAL 'alias') $(RULE aliasInitializer) $(LPAREN)$(LITERAL ',') $(RULE aliasInitializer)$(RPAREN)* + * $(LITERAL 'alias') $(RULE aliasInitializer) $(LPAREN)$(LITERAL ',') $(RULE aliasInitializer)$(RPAREN)* $(LITERAL ';') * | $(LITERAL 'alias') $(RULE type) $(LITERAL identifier) $(LITERAL ';') * ;) */ @@ -6423,7 +6423,7 @@ private: bool startsWith(TokenType[] types...) const nothrow { - if (index >= tokens.length) + if (index + types.length >= tokens.length) return false; for (size_t i = 0; (i < types.length) && ((index + i) < tokens.length); ++i) {