Skip to content

Commit

Permalink
Merge pull request #1031 from m0rkeulv/feature/bnf-ForLoopRecover
Browse files Browse the repository at this point in the history
Adding recovery for `ForStatement`
  • Loading branch information
EricBishton authored Oct 26, 2020
2 parents fb7d35f + 1d884f0 commit ab25833
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions grammar/haxe.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,12 @@ private notBlockStatement ::= ('untyped' statement ';'?)
| tryStatement
| expression

forStatement ::= 'for' '(' forDeclaration 'in' iterable')' statement ';'?
{mixin="com.intellij.plugins.haxe.lang.psi.impl.HaxeForStatementPsiMixinImpl" implements="com.intellij.plugins.haxe.lang.psi.HaxeForStatementPsiMixin"}

forStatement ::= 'for' '(' iterableDeclaration ')' statement ';'?
{recoverWhile=forStatement_recover mixin="com.intellij.plugins.haxe.lang.psi.impl.HaxeForStatementPsiMixinImpl" implements="com.intellij.plugins.haxe.lang.psi.HaxeForStatementPsiMixin"}
// XXX: Somehow or another, forStatement must derive from AbstractHaxeNamedComponent, or variable resolution will break.
private iterableDeclaration ::= forDeclaration 'in' iterable {pin=1 recoverWhile="iterable_decl_recovery"}
private iterable_decl_recovery ::= !(')')
private forDeclaration ::= keyValueIterator | componentName
iteratorkey ::= componentName
{mixin="com.intellij.plugins.haxe.lang.psi.impl.AbstractHaxeNamedComponent" implements="com.intellij.plugins.haxe.lang.psi.HaxeComponent"}
Expand Down

0 comments on commit ab25833

Please sign in to comment.