This commit is contained in:
@@ -77,15 +77,10 @@ class ASTExtension {
|
|||||||
for (i in startingIndex...findEOF(ast, currentFile)) {
|
for (i in startingIndex...findEOF(ast, currentFile)) {
|
||||||
switch (ast[i].expr) {
|
switch (ast[i].expr) {
|
||||||
// Gather choices of the current depth
|
// Gather choices of the current depth
|
||||||
case EChoice(choice):
|
case EChoice(choice) if (tryAdd(choice, [])):
|
||||||
if (tryAdd(choice, [])) lastChoiceIndex = i;
|
lastChoiceIndex = i;
|
||||||
case ETagged(EChoice(choice), tags):
|
case ETagged(EChoice(choice), tags) if (tryAdd(choice, tags)):
|
||||||
if (tryAdd(choice, tags)) lastChoiceIndex = i;
|
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;
|
|
||||||
// Stop at the next gather of this depth
|
// Stop at the next gather of this depth
|
||||||
case EGather(_, d, _) if (d == depth):
|
case EGather(_, d, _) if (d == depth):
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -192,13 +192,7 @@ class Parser {
|
|||||||
var label = buffer.expressionIfNext('(', ')');
|
var label = buffer.expressionIfNext('(', ')');
|
||||||
buffer.skipWhitespace('\n');
|
buffer.skipWhitespace('\n');
|
||||||
|
|
||||||
var gatherOp = switch (buffer.peekLine()) {
|
return EGather(label, depth, ENoOp);
|
||||||
case Some("") | None:
|
|
||||||
ENoOp;
|
|
||||||
default:
|
|
||||||
parseExpr(buffer, buffer.position());
|
|
||||||
}
|
|
||||||
return EGather(label, depth, gatherOp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static var choices:Int = 0;
|
static var choices:Int = 0;
|
||||||
|
|||||||
@@ -319,7 +319,8 @@ class Story {
|
|||||||
case None:
|
case None:
|
||||||
}
|
}
|
||||||
weaveDepth = depth;
|
weaveDepth = depth;
|
||||||
return processExpr(nextExpr);
|
++exprIndex;
|
||||||
|
return nextFrame();
|
||||||
|
|
||||||
case EChoice(choice):
|
case EChoice(choice):
|
||||||
if (choice.depth > weaveDepth) {
|
if (choice.depth > weaveDepth) {
|
||||||
|
|||||||
Reference in New Issue
Block a user