tree-sitter/include/tree_sitter/compiler.h
Max Brunsfeld e17cd42e47 Perform keyword optimization using explicitly selected word token
rather than trying to infer the word token automatically.

Co-Authored-By: Ashi Krishnan <queerviolet@github.com>
2018-06-14 09:35:54 -07:00

37 lines
837 B
C

#ifndef TREE_SITTER_COMPILER_H_
#define TREE_SITTER_COMPILER_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
typedef enum {
TSCompileErrorTypeNone,
TSCompileErrorTypeInvalidGrammar,
TSCompileErrorTypeInvalidRegex,
TSCompileErrorTypeUndefinedSymbol,
TSCompileErrorTypeInvalidExtraToken,
TSCompileErrorTypeInvalidExternalToken,
TSCompileErrorTypeLexConflict,
TSCompileErrorTypeParseConflict,
TSCompileErrorTypeEpsilonRule,
TSCompileErrorTypeInvalidTokenContents,
TSCompileErrorTypeInvalidRuleName,
TSCompileErrorTypeInvalidWordRule,
} TSCompileErrorType;
typedef struct {
char *code;
char *error_message;
TSCompileErrorType error_type;
} TSCompileResult;
TSCompileResult ts_compile_grammar(const char *input, FILE *log_file);
#ifdef __cplusplus
}
#endif
#endif // TREE_SITTER_COMPILER_H_