Skip to content

Commit 4cb5b93

Browse files
feat: regenerate grammars
1 parent 6b3886b commit 4cb5b93

File tree

21 files changed

+260
-155
lines changed

21 files changed

+260
-155
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

grammar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ module.exports = grammar({
5555
$._r_sgl_pln_bol_blk, $._br_sgl_pln_bol_blk, $._b_sgl_pln_bol_blk, $._r_sgl_pln_bol_flw, $._br_sgl_pln_bol_flw,
5656
$._r_sgl_pln_int_blk, $._br_sgl_pln_int_blk, $._b_sgl_pln_int_blk, $._r_sgl_pln_int_flw, $._br_sgl_pln_int_flw,
5757
$._r_sgl_pln_flt_blk, $._br_sgl_pln_flt_blk, $._b_sgl_pln_flt_blk, $._r_sgl_pln_flt_flw, $._br_sgl_pln_flt_flw,
58+
$._r_sgl_pln_tms_blk, $._br_sgl_pln_tms_blk, $._b_sgl_pln_tms_blk, $._r_sgl_pln_tms_flw, $._br_sgl_pln_tms_flw,
5859
$._r_sgl_pln_str_blk, $._br_sgl_pln_str_blk, $._b_sgl_pln_str_blk, $._r_sgl_pln_str_flw, $._br_sgl_pln_str_flw,
5960

6061
// plain scalar (multiline in block/flow)

schema/core/package.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

schema/core/src/grammar.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,6 @@
177177
"precedences": [],
178178
"externals": [],
179179
"inline": [],
180-
"supertypes": []
181-
}
180+
"supertypes": [],
181+
"reserved": {}
182+
}

schema/core/src/parser.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* Automatically @generated by tree-sitter v0.25.4 (726dcd1e872149d95de581589fc408fb8ea9cb0b) */
2+
13
#include "tree_sitter/parser.h"
24

35
#if defined(__GNUC__) || defined(__clang__)
@@ -13,7 +15,9 @@
1315
#define EXTERNAL_TOKEN_COUNT 0
1416
#define FIELD_COUNT 0
1517
#define MAX_ALIAS_SEQUENCE_LENGTH 1
18+
#define MAX_RESERVED_WORD_SET_SIZE 0
1619
#define PRODUCTION_ID_COUNT 1
20+
#define SUPERTYPE_COUNT 0
1721

1822
enum ts_symbol_identifiers {
1923
sym_null = 1,
@@ -280,14 +284,14 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = {
280284
};
281285

282286
static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
283-
[0] = {
287+
[STATE(0)] = {
284288
[ts_builtin_sym_end] = ACTIONS(1),
285289
[sym_null] = ACTIONS(1),
286290
[sym_bool] = ACTIONS(1),
287291
[sym_int] = ACTIONS(1),
288292
[sym_float] = ACTIONS(1),
289293
},
290-
[1] = {
294+
[STATE(1)] = {
291295
[sym_scalar] = STATE(3),
292296
[sym_null] = ACTIONS(3),
293297
[sym_bool] = ACTIONS(3),
@@ -332,7 +336,7 @@ extern "C" {
332336

333337
TS_PUBLIC const TSLanguage *tree_sitter_core_schema(void) {
334338
static const TSLanguage language = {
335-
.version = LANGUAGE_VERSION,
339+
.abi_version = LANGUAGE_VERSION,
336340
.symbol_count = SYMBOL_COUNT,
337341
.alias_count = ALIAS_COUNT,
338342
.token_count = TOKEN_COUNT,
@@ -351,7 +355,7 @@ TS_PUBLIC const TSLanguage *tree_sitter_core_schema(void) {
351355
.public_symbol_map = ts_symbol_map,
352356
.alias_map = ts_non_terminal_alias_map,
353357
.alias_sequences = &ts_alias_sequences[0][0],
354-
.lex_modes = ts_lex_modes,
358+
.lex_modes = (const void*)ts_lex_modes,
355359
.lex_fn = ts_lex,
356360
.primary_state_ids = ts_primary_state_ids,
357361
};

schema/core/src/tree_sitter/array.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ extern "C" {
1414
#include <string.h>
1515

1616
#ifdef _MSC_VER
17+
#pragma warning(push)
1718
#pragma warning(disable : 4101)
1819
#elif defined(__GNUC__) || defined(__clang__)
1920
#pragma GCC diagnostic push
@@ -278,7 +279,7 @@ static inline void _array__splice(Array *self, size_t element_size,
278279
#define _compare_int(a, b) ((int)*(a) - (int)(b))
279280

280281
#ifdef _MSC_VER
281-
#pragma warning(default : 4101)
282+
#pragma warning(pop)
282283
#elif defined(__GNUC__) || defined(__clang__)
283284
#pragma GCC diagnostic pop
284285
#endif

schema/core/src/tree_sitter/parser.h

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ typedef uint16_t TSStateId;
1818
typedef uint16_t TSSymbol;
1919
typedef uint16_t TSFieldId;
2020
typedef struct TSLanguage TSLanguage;
21+
typedef struct TSLanguageMetadata {
22+
uint8_t major_version;
23+
uint8_t minor_version;
24+
uint8_t patch_version;
25+
} TSLanguageMetadata;
2126
#endif
2227

2328
typedef struct {
@@ -26,10 +31,11 @@ typedef struct {
2631
bool inherited;
2732
} TSFieldMapEntry;
2833

34+
// Used to index the field and supertype maps.
2935
typedef struct {
3036
uint16_t index;
3137
uint16_t length;
32-
} TSFieldMapSlice;
38+
} TSMapSlice;
3339

3440
typedef struct {
3541
bool visible;
@@ -79,6 +85,12 @@ typedef struct {
7985
uint16_t external_lex_state;
8086
} TSLexMode;
8187

88+
typedef struct {
89+
uint16_t lex_state;
90+
uint16_t external_lex_state;
91+
uint16_t reserved_word_set_id;
92+
} TSLexerMode;
93+
8294
typedef union {
8395
TSParseAction action;
8496
struct {
@@ -93,7 +105,7 @@ typedef struct {
93105
} TSCharacterRange;
94106

95107
struct TSLanguage {
96-
uint32_t version;
108+
uint32_t abi_version;
97109
uint32_t symbol_count;
98110
uint32_t alias_count;
99111
uint32_t token_count;
@@ -109,13 +121,13 @@ struct TSLanguage {
109121
const TSParseActionEntry *parse_actions;
110122
const char * const *symbol_names;
111123
const char * const *field_names;
112-
const TSFieldMapSlice *field_map_slices;
124+
const TSMapSlice *field_map_slices;
113125
const TSFieldMapEntry *field_map_entries;
114126
const TSSymbolMetadata *symbol_metadata;
115127
const TSSymbol *public_symbol_map;
116128
const uint16_t *alias_map;
117129
const TSSymbol *alias_sequences;
118-
const TSLexMode *lex_modes;
130+
const TSLexerMode *lex_modes;
119131
bool (*lex_fn)(TSLexer *, TSStateId);
120132
bool (*keyword_lex_fn)(TSLexer *, TSStateId);
121133
TSSymbol keyword_capture_token;
@@ -129,23 +141,31 @@ struct TSLanguage {
129141
void (*deserialize)(void *, const char *, unsigned);
130142
} external_scanner;
131143
const TSStateId *primary_state_ids;
144+
const char *name;
145+
const TSSymbol *reserved_words;
146+
uint16_t max_reserved_word_set_size;
147+
uint32_t supertype_count;
148+
const TSSymbol *supertype_symbols;
149+
const TSMapSlice *supertype_map_slices;
150+
const TSSymbol *supertype_map_entries;
151+
TSLanguageMetadata metadata;
132152
};
133153

134-
static inline bool set_contains(TSCharacterRange *ranges, uint32_t len, int32_t lookahead) {
154+
static inline bool set_contains(const TSCharacterRange *ranges, uint32_t len, int32_t lookahead) {
135155
uint32_t index = 0;
136156
uint32_t size = len - index;
137157
while (size > 1) {
138158
uint32_t half_size = size / 2;
139159
uint32_t mid_index = index + half_size;
140-
TSCharacterRange *range = &ranges[mid_index];
160+
const TSCharacterRange *range = &ranges[mid_index];
141161
if (lookahead >= range->start && lookahead <= range->end) {
142162
return true;
143163
} else if (lookahead > range->end) {
144164
index = mid_index;
145165
}
146166
size -= half_size;
147167
}
148-
TSCharacterRange *range = &ranges[index];
168+
const TSCharacterRange *range = &ranges[index];
149169
return (lookahead >= range->start && lookahead <= range->end);
150170
}
151171

schema/json/package.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

schema/json/src/grammar.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,6 @@
6666
"precedences": [],
6767
"externals": [],
6868
"inline": [],
69-
"supertypes": []
70-
}
69+
"supertypes": [],
70+
"reserved": {}
71+
}

schema/json/src/parser.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* Automatically @generated by tree-sitter v0.25.4 (726dcd1e872149d95de581589fc408fb8ea9cb0b) */
2+
13
#include "tree_sitter/parser.h"
24

35
#if defined(__GNUC__) || defined(__clang__)
@@ -13,7 +15,9 @@
1315
#define EXTERNAL_TOKEN_COUNT 0
1416
#define FIELD_COUNT 0
1517
#define MAX_ALIAS_SEQUENCE_LENGTH 1
18+
#define MAX_RESERVED_WORD_SET_SIZE 0
1619
#define PRODUCTION_ID_COUNT 1
20+
#define SUPERTYPE_COUNT 0
1721

1822
enum ts_symbol_identifiers {
1923
sym_null = 1,
@@ -180,14 +184,14 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = {
180184
};
181185

182186
static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
183-
[0] = {
187+
[STATE(0)] = {
184188
[ts_builtin_sym_end] = ACTIONS(1),
185189
[sym_null] = ACTIONS(1),
186190
[sym_bool] = ACTIONS(1),
187191
[sym_int] = ACTIONS(1),
188192
[sym_float] = ACTIONS(1),
189193
},
190-
[1] = {
194+
[STATE(1)] = {
191195
[sym_scalar] = STATE(3),
192196
[sym_null] = ACTIONS(3),
193197
[sym_bool] = ACTIONS(3),
@@ -232,7 +236,7 @@ extern "C" {
232236

233237
TS_PUBLIC const TSLanguage *tree_sitter_json_schema(void) {
234238
static const TSLanguage language = {
235-
.version = LANGUAGE_VERSION,
239+
.abi_version = LANGUAGE_VERSION,
236240
.symbol_count = SYMBOL_COUNT,
237241
.alias_count = ALIAS_COUNT,
238242
.token_count = TOKEN_COUNT,
@@ -251,7 +255,7 @@ TS_PUBLIC const TSLanguage *tree_sitter_json_schema(void) {
251255
.public_symbol_map = ts_symbol_map,
252256
.alias_map = ts_non_terminal_alias_map,
253257
.alias_sequences = &ts_alias_sequences[0][0],
254-
.lex_modes = ts_lex_modes,
258+
.lex_modes = (const void*)ts_lex_modes,
255259
.lex_fn = ts_lex,
256260
.primary_state_ids = ts_primary_state_ids,
257261
};

0 commit comments

Comments
 (0)