}
public static class TestCase {
- private final Token.Stream inp;
- public final String input;
+ private final boolean tib;
+ public final String input;
public final String[] output;
public final Union grammar;
public TestCase(String input, String[] output, Union grammar, boolean tib) throws IOException {
- this.inp = tib
- ? new Tib(input)
- : new CharToken.Stream(new StringReader(input), input.indexOf('\n')==-1?"\""+input+"\": ":"");
+ this.tib = tib;
this.input = input;
this.output = output;
this.grammar = grammar;
Forest<String> res = null;
ParseFailed pfe = null;
try {
- res = new CharToStringParser(grammar).parse(inp);
+ res = tib
+ ? new CharToStringParser(grammar).parse(new Tib(input))
+ : new CharToStringParser(grammar).parse(new StringReader(input));
} catch (ParseFailed pf) {
pfe = pf;
}