tree-sitter/spec/compiler/compile_spec.cc
Max Brunsfeld 9a198562e0 Treat parse conflicts as errors in grammar compilation
For now, only reduce/reduce conflicts w/ no tie-breaking precedence
are treated as errors. The rest are dropped, because shift/reduce
conflicts are currently very common because we don't have a way
of specifying associativity along w/ precedence.
2015-03-15 20:31:41 -07:00

22 lines
506 B
C++

#include "compiler/compiler_spec_helper.h"
#include "tree_sitter/compiler.h"
using namespace rules;
START_TEST
describe("Compile", []() {
describe("when the grammar's start symbol is a token", [&]() {
it("does not fail", [&]() {
Grammar grammar({
{ "rule1", str("the-value") }
});
auto result = compile(grammar, "test_grammar");
const GrammarError *error = result.second;
AssertThat(error, Equals<const GrammarError *>(nullptr));
});
});
});
END_TEST