tree-sitter/spec/compiler/compile_fixtures.cpp
Max Brunsfeld 7a3092b765 Refactor parser error messages
- move message generation to TSParseError,
  so that Parser doesn’t need to import <string>, and can
  be compiled as plain C.
2014-01-11 17:59:45 -08:00

17 lines
No EOL
433 B
C++

#include "spec_helper.h"
#include "compile.h"
#include "../fixtures/grammars/arithmetic.h"
#include <fstream>
START_TEST
describe("compiling grammars", []() {
string test_parser_dir = src_dir() + "/spec/fixtures/parsers";
it("works for the arithmetic grammar", [&]() {
Grammar grammar = test_grammars::arithmetic();
ofstream(test_parser_dir + "/arithmetic.c") << compile(grammar);
});
});
END_TEST