Make compile take a name argument
Start work on JSON fixture grammar
This commit is contained in:
parent
bb42543f1b
commit
5776846227
12 changed files with 603 additions and 24 deletions
|
|
@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue