diff --git a/hank/HankAST.hx b/hank/HankAST.hx index a0f79de..e886eb2 100644 --- a/hank/HankAST.hx +++ b/hank/HankAST.hx @@ -77,15 +77,10 @@ class ASTExtension { for (i in startingIndex...findEOF(ast, currentFile)) { switch (ast[i].expr) { // Gather choices of the current depth - case EChoice(choice): - if (tryAdd(choice, [])) lastChoiceIndex = i; - case ETagged(EChoice(choice), tags): - if (tryAdd(choice, tags)) lastChoiceIndex = i; - // Choice immediatly after gather at current depth: - case EGather(_, d, EChoice(choice)) if(i == startingIndex && d == depth): - if (tryAdd(choice, [])) lastChoiceIndex = i; - case EGather(_, d, ETagged(EChoice(choice), tags)) if(i == startingIndex && d == depth): - if (tryAdd(choice, tags)) lastChoiceIndex = i; + case EChoice(choice) if (tryAdd(choice, [])): + lastChoiceIndex = i; + case ETagged(EChoice(choice), tags) if (tryAdd(choice, tags)): + lastChoiceIndex = i; // Stop at the next gather of this depth case EGather(_, d, _) if (d == depth): break; diff --git a/hank/Parser.hx b/hank/Parser.hx index d4d5626..fcbf2fa 100644 --- a/hank/Parser.hx +++ b/hank/Parser.hx @@ -192,13 +192,7 @@ class Parser { var label = buffer.expressionIfNext('(', ')'); buffer.skipWhitespace('\n'); - var gatherOp = switch (buffer.peekLine()) { - case Some("") | None: - ENoOp; - default: - parseExpr(buffer, buffer.position()); - } - return EGather(label, depth, gatherOp); + return EGather(label, depth, ENoOp); } static var choices:Int = 0; diff --git a/hank/Story.hx b/hank/Story.hx index 8ec9bec..31b3352 100644 --- a/hank/Story.hx +++ b/hank/Story.hx @@ -319,7 +319,8 @@ class Story { case None: } weaveDepth = depth; - return processExpr(nextExpr); + ++exprIndex; + return nextFrame(); case EChoice(choice): if (choice.depth > weaveDepth) {