Fixed problem in startsWith. Fixed grammar error

This commit is contained in:
Hackerpilot 2013-09-10 22:46:39 -07:00
parent 0cc768260e
commit ebbb1907d1
1 changed files with 2 additions and 2 deletions

View File

@ -111,7 +111,7 @@ struct Parser
* Parses an AliasDeclaration. * Parses an AliasDeclaration.
* *
* $(GRAMMAR $(RULEDEF 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 ';') * | $(LITERAL 'alias') $(RULE type) $(LITERAL identifier) $(LITERAL ';')
* ;) * ;)
*/ */
@ -6423,7 +6423,7 @@ private:
bool startsWith(TokenType[] types...) const nothrow bool startsWith(TokenType[] types...) const nothrow
{ {
if (index >= tokens.length) if (index + types.length >= tokens.length)
return false; return false;
for (size_t i = 0; (i < types.length) && ((index + i) < tokens.length); ++i) for (size_t i = 0; (i < types.length) && ((index + i) < tokens.length); ++i)
{ {