diff --git a/spec/compiler/compile_examples.cc b/spec/compiler/compile_examples.cc index 004dcd51..87a239d0 100644 --- a/spec/compiler/compile_examples.cc +++ b/spec/compiler/compile_examples.cc @@ -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 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(); });