Make compile take a name argument

Start work on JSON fixture grammar
This commit is contained in:
Max Brunsfeld 2014-01-23 13:44:49 -08:00
parent bb42543f1b
commit 5776846227
12 changed files with 603 additions and 24 deletions

View file

@ -1,6 +1,6 @@
#include "spec_helper.h"
#include "compile.h"
#include "../fixtures/grammars/arithmetic.h"
#include "../fixtures/grammars/test_grammars.h"
#include <fstream>
START_TEST
@ -10,7 +10,12 @@ describe("compiling grammars", []() {
it("works for the arithmetic grammar", [&]() {
Grammar grammar = test_grammars::arithmetic();
ofstream(test_parser_dir + "/arithmetic.c") << compile(grammar);
ofstream(test_parser_dir + "/arithmetic.c") << compile(grammar, "arithmetic");
});
it("works for the json grammar", [&]() {
Grammar grammar = test_grammars::json();
ofstream(test_parser_dir + "/json.c") << compile(grammar, "json");
});
});