Fixing whitespace errors and cleaning error message alert to be clearer.

This commit is contained in:
Clint Herron 2024-04-04 09:43:14 -04:00
parent 345eae3021
commit b7264d6efd

View file

@ -30,12 +30,14 @@ expr ::= term ("+" term)*
term ::= numero
number ::= [0-9]+)""";
fprintf(stderr, "NOTE: Error message (\"error parsing grammar\") expected on following line during successful test:\n");
grammar_parser::parse_state parsed_grammar = grammar_parser::parse(grammar_str.c_str());
// Ensure we did NOT parsed correctly
assert(parsed_grammar.rules.empty());
fprintf(stderr, "^ If previous line displays an error, then this test passed.\n");
fprintf(stderr, "End of expected error message. Test successful.\n");
}
static void test_simple_grammar() {