Expose all grammar compilation errors

This commit is contained in:
Max Brunsfeld 2014-05-01 23:28:40 -07:00
parent e36d586817
commit 3a50171249
15 changed files with 79 additions and 49 deletions

View file

@ -22,11 +22,16 @@ describe("compiling the example grammars", []() {
auto compile_grammar = [&](const Grammar &grammar, string language) {
it(("compiles the " + language + " grammar").c_str(), [&]() {
ofstream file(example_parser_dir + language + ".c");
auto result = compile(grammar, language);
string code = get<0>(result);
vector<Conflict> conflicts = get<1>(result);
const GrammarError *error = get<2>(result);
// cout << "\n\nconflicts for " << language << ":\n" << result.second;
AssertThat(error, Equals((GrammarError *)nullptr));
// cout << "\n\nconflicts for " << language << ":\n" << get<1>(result);
file << result.first;
file << get<0>(result);
file.close();
});
};