Put example grammars in tree_sitter::examples ns
This commit is contained in:
parent
3a7c4bb5b1
commit
06cd18b483
7 changed files with 104 additions and 101 deletions
|
|
@ -1,6 +1,5 @@
|
|||
#include "compiler_spec_helper.h"
|
||||
#include "grammars/json.hpp"
|
||||
#include "grammars/arithmetic.hpp"
|
||||
#include "helpers/example_grammars.h"
|
||||
#include <fstream>
|
||||
|
||||
static string src_dir() {
|
||||
|
|
@ -15,12 +14,12 @@ describe("compiling the example grammars", []() {
|
|||
string example_parser_dir = src_dir() + "/examples/parsers/";
|
||||
|
||||
it("compiles the arithmetic grammar", [&]() {
|
||||
Grammar grammar = test_grammars::arithmetic();
|
||||
Grammar grammar = examples::arithmetic();
|
||||
ofstream(example_parser_dir + "arithmetic.c") << compile(grammar, "arithmetic");
|
||||
});
|
||||
|
||||
it("compiles the json grammar", [&]() {
|
||||
Grammar grammar = test_grammars::json();
|
||||
Grammar grammar = examples::json();
|
||||
ofstream(example_parser_dir + "json.c") << compile(grammar, "json");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue