@Test public void should_report_error_at_correct_index() { Rule rule = new MutableParsingRule("rule").is(GrammarOperators.nextNot("foo")); ParseRunner runner = new ParseRunner(rule); ParsingResult result = runner.parse("foo".toCharArray()); assertThat(result.isMatched()).isFalse(); ParseError parseError = result.getParseError(); System.out.println(new ParseErrorFormatter().format(parseError)); assertThat(parseError.getErrorIndex()).isEqualTo(0); }
public ParsingResult parse(char[] input) { return Machine.parse(input, compiledGrammar); }
ParseRunner { public ParsingResult parse(char[] input) { return Machine.parse(input, compiledGrammar); } }
ParseRunner { public ParsingResult parse(char[] input) { return Machine.parse(input, compiledGrammar); } ParseRunner(Rule rule); }
ParseRunner { public ParsingResult parse(char[] input) { return Machine.parse(input, compiledGrammar); } ParseRunner(Rule rule); ParsingResult parse(char[] input); }
ParseRunner { public ParsingResult parse(char[] input) { return Machine.parse(input, compiledGrammar); } ParseRunner(Rule rule); ParsingResult parse(char[] input);  }