|
|
|
|
@ -13,9 +13,8 @@ extern "C" {
|
|
|
|
|
#define ts_builtin_sym_end 0
|
|
|
|
|
#define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024
|
|
|
|
|
|
|
|
|
|
typedef uint16_t TSStateId;
|
|
|
|
|
|
|
|
|
|
#ifndef TREE_SITTER_API_H_
|
|
|
|
|
typedef uint16_t TSStateId;
|
|
|
|
|
typedef uint16_t TSSymbol;
|
|
|
|
|
typedef uint16_t TSFieldId;
|
|
|
|
|
typedef struct TSLanguage TSLanguage;
|
|
|
|
|
@ -130,9 +129,16 @@ struct TSLanguage {
|
|
|
|
|
* Lexer Macros
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
|
#define UNUSED __pragma(warning(suppress : 4101))
|
|
|
|
|
#else
|
|
|
|
|
#define UNUSED __attribute__((unused))
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#define START_LEXER() \
|
|
|
|
|
bool result = false; \
|
|
|
|
|
bool skip = false; \
|
|
|
|
|
UNUSED \
|
|
|
|
|
bool eof = false; \
|
|
|
|
|
int32_t lookahead; \
|
|
|
|
|
goto start; \
|
|
|
|
|
@ -166,7 +172,7 @@ struct TSLanguage {
|
|
|
|
|
* Parse Table Macros
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#define SMALL_STATE(id) id - LARGE_STATE_COUNT
|
|
|
|
|
#define SMALL_STATE(id) ((id) - LARGE_STATE_COUNT)
|
|
|
|
|
|
|
|
|
|
#define STATE(id) id
|
|
|
|
|
|
|
|
|
|
@ -176,7 +182,7 @@ struct TSLanguage {
|
|
|
|
|
{{ \
|
|
|
|
|
.shift = { \
|
|
|
|
|
.type = TSParseActionTypeShift, \
|
|
|
|
|
.state = state_value \
|
|
|
|
|
.state = (state_value) \
|
|
|
|
|
} \
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
|
|
@ -184,7 +190,7 @@ struct TSLanguage {
|
|
|
|
|
{{ \
|
|
|
|
|
.shift = { \
|
|
|
|
|
.type = TSParseActionTypeShift, \
|
|
|
|
|
.state = state_value, \
|
|
|
|
|
.state = (state_value), \
|
|
|
|
|
.repetition = true \
|
|
|
|
|
} \
|
|
|
|
|
}}
|
|
|
|
|
|