clang-format
This commit is contained in:
parent
3dea1261a6
commit
9c0b5b5571
2 changed files with 12 additions and 10 deletions
|
|
@ -104,15 +104,15 @@ struct TSLanguage {
|
|||
|
||||
#define START_TOKEN() ts_lexer_start_token(lexer);
|
||||
|
||||
#define ADVANCE(state_index) \
|
||||
{ \
|
||||
DEBUG_LEX("ADVANCE %d", state_index); \
|
||||
if (!ts_lexer_advance(lexer)) { \
|
||||
DEBUG_LEX("END"); \
|
||||
#define ADVANCE(state_index) \
|
||||
{ \
|
||||
DEBUG_LEX("ADVANCE %d", state_index); \
|
||||
if (!ts_lexer_advance(lexer)) { \
|
||||
DEBUG_LEX("END"); \
|
||||
return ts_lexer_accept(lexer, ts_builtin_sym_end, 0); \
|
||||
} \
|
||||
lex_state = state_index; \
|
||||
goto next_state; \
|
||||
} \
|
||||
lex_state = state_index; \
|
||||
goto next_state; \
|
||||
}
|
||||
|
||||
#define ACCEPT_TOKEN(symbol) \
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@
|
|||
#include "tree_sitter/parser.h"
|
||||
#include "runtime/tree.h"
|
||||
|
||||
TSTree *ts_tree_make_leaf(TSSymbol sym, size_t size, size_t padding, bool is_hidden) {
|
||||
TSTree *ts_tree_make_leaf(TSSymbol sym, size_t size, size_t padding,
|
||||
bool is_hidden) {
|
||||
TSTree *result = malloc(sizeof(TSTree));
|
||||
*result = (TSTree) { .ref_count = 1,
|
||||
.symbol = sym,
|
||||
|
|
@ -18,7 +19,8 @@ TSTree *ts_tree_make_leaf(TSSymbol sym, size_t size, size_t padding, bool is_hid
|
|||
}
|
||||
|
||||
TSTree *ts_tree_make_error(size_t size, size_t padding, char lookahead_char) {
|
||||
TSTree *result = ts_tree_make_leaf(ts_builtin_sym_error, size, padding, false);
|
||||
TSTree *result =
|
||||
ts_tree_make_leaf(ts_builtin_sym_error, size, padding, false);
|
||||
result->lookahead_char = lookahead_char;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue