Don't open parser C file until code is generated
This commit is contained in:
parent
91cf35b72c
commit
eaeb51a96f
1 changed files with 1 additions and 2 deletions
|
|
@ -23,8 +23,6 @@ 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);
|
||||
|
|
@ -32,6 +30,7 @@ describe("compiling the example grammars", []() {
|
|||
|
||||
AssertThat(error, Equals((GrammarError *)nullptr));
|
||||
|
||||
ofstream file(example_parser_dir + language + ".c");
|
||||
file << get<0>(result);
|
||||
file.close();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue