Approaching Alt expression parsing
This commit is contained in:
@@ -4,6 +4,8 @@ import hank.Parser;
|
||||
import hank.Parser.HankAST;
|
||||
import hank.Output;
|
||||
import hank.Output.OutputType;
|
||||
import hank.Alt;
|
||||
import hank.Alt.AltBehavior;
|
||||
|
||||
class ParserTest extends utest.Test {
|
||||
var ast: HankAST;
|
||||
@@ -25,6 +27,21 @@ class ParserTest extends utest.Test {
|
||||
assertNextExpr(EOutput(new Output([Text("A line won't be interrupted or anything.")])));
|
||||
assertNextExpr(EOutput(new Output([Text("Multiline comments an output expression. This should parse as one line of output.")])));
|
||||
assertNextExpr(EOutput(new Output([Text("Comments at the end of lines won't parse as part of the Output.")])));
|
||||
assertNextExpr(EOutput(new Output([Text("You can "), HExpression("insert"), Text(" the values of expressions.")])));
|
||||
assertNextExpr(EOutput(new Output([HExpression("you"), Text(" can start an output line with an insert expression. "), HExpression("and_end_one")])));
|
||||
|
||||
assertNextExpr(
|
||||
EOutput(new Output([
|
||||
AltExpression(
|
||||
new Alt(
|
||||
Shuffle,
|
||||
[
|
||||
new Output([Text("Things get weird"), Text("when you start to use sequence expressions.")])
|
||||
]
|
||||
)
|
||||
)
|
||||
]))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user