Add plain C API for compiling a JSON grammar

This commit is contained in:
Max Brunsfeld 2016-01-10 13:44:22 -08:00
parent 36870bfced
commit b69e19c525
6 changed files with 369 additions and 0 deletions

View file

@ -54,6 +54,12 @@ class GrammarError {
std::pair<std::string, const GrammarError *> compile(const Grammar &,
std::string);
struct CompileResult {
const char *code;
const char *error_message;
};
extern "C" CompileResult compile(const char *input);
} // namespace tree_sitter