Skip to content

Commit 8ea2f2e

Browse files
committed
chore: generate
1 parent ad02034 commit 8ea2f2e

File tree

10 files changed

+733666
-369750
lines changed

10 files changed

+733666
-369750
lines changed

tsx/src/grammar.json

Lines changed: 510 additions & 226 deletions
Large diffs are not rendered by default.

tsx/src/node-types.json

Lines changed: 170 additions & 45 deletions
Large diffs are not rendered by default.

tsx/src/parser.c

Lines changed: 363801 additions & 186987 deletions
Large diffs are not rendered by default.

tsx/src/scanner.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
#include "../../common/scanner.h"
22

33
void *tree_sitter_tsx_external_scanner_create() { return NULL; }
4-
void tree_sitter_tsx_external_scanner_destroy(void *p) {}
5-
void tree_sitter_tsx_external_scanner_reset(void *p) {}
6-
unsigned tree_sitter_tsx_external_scanner_serialize(void *p, char *buffer) { return 0; }
7-
void tree_sitter_tsx_external_scanner_deserialize(void *p, const char *b, unsigned n) {}
4+
5+
void tree_sitter_tsx_external_scanner_destroy(void *payload) {}
6+
7+
void tree_sitter_tsx_external_scanner_reset(void *payload) {}
8+
9+
unsigned tree_sitter_tsx_external_scanner_serialize(void *payload, char *buffer) { return 0; }
10+
11+
void tree_sitter_tsx_external_scanner_deserialize(void *payload, const char *buffer, unsigned length) {}
812

913
bool tree_sitter_tsx_external_scanner_scan(void *payload, TSLexer *lexer, const bool *valid_symbols) {
10-
return external_scanner_scan(payload, lexer, valid_symbols);
14+
return external_scanner_scan(payload, lexer, valid_symbols);
1115
}

tsx/src/tree_sitter/parser.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ extern "C" {
1313
#define ts_builtin_sym_end 0
1414
#define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024
1515

16-
typedef uint16_t TSStateId;
17-
1816
#ifndef TREE_SITTER_API_H_
17+
typedef uint16_t TSStateId;
1918
typedef uint16_t TSSymbol;
2019
typedef uint16_t TSFieldId;
2120
typedef struct TSLanguage TSLanguage;
@@ -130,9 +129,16 @@ struct TSLanguage {
130129
* Lexer Macros
131130
*/
132131

132+
#ifdef _MSC_VER
133+
#define UNUSED __pragma(warning(suppress : 4101))
134+
#else
135+
#define UNUSED __attribute__((unused))
136+
#endif
137+
133138
#define START_LEXER() \
134139
bool result = false; \
135140
bool skip = false; \
141+
UNUSED \
136142
bool eof = false; \
137143
int32_t lookahead; \
138144
goto start; \
@@ -166,7 +172,7 @@ struct TSLanguage {
166172
* Parse Table Macros
167173
*/
168174

169-
#define SMALL_STATE(id) id - LARGE_STATE_COUNT
175+
#define SMALL_STATE(id) ((id) - LARGE_STATE_COUNT)
170176

171177
#define STATE(id) id
172178

@@ -176,15 +182,15 @@ struct TSLanguage {
176182
{{ \
177183
.shift = { \
178184
.type = TSParseActionTypeShift, \
179-
.state = state_value \
185+
.state = (state_value) \
180186
} \
181187
}}
182188

183189
#define SHIFT_REPEAT(state_value) \
184190
{{ \
185191
.shift = { \
186192
.type = TSParseActionTypeShift, \
187-
.state = state_value, \
193+
.state = (state_value), \
188194
.repetition = true \
189195
} \
190196
}}

0 commit comments

Comments
 (0)