Skip to content

Commit e0888a8

Browse files
committed
Update deps, Reorganize tests
1 parent d835774 commit e0888a8

File tree

10 files changed

+144
-153
lines changed

10 files changed

+144
-153
lines changed

package-lock.json

Lines changed: 96 additions & 126 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
"scripts": {
1515
"build": "tree-sitter generate && node-gyp build --debug",
1616
"install": "prebuild-install || node-gyp rebuild",
17-
"dist": "prebuild -r electron -t 3.0.0 -t 4.0.0 -t 4.0.4 -t 5.0.0 --strip && prebuild -t 8.16.0 -t 10.16.1 --strip",
17+
"dist": "prebuild -r electron -t 3.0.0 -t 4.0.0 -t 4.0.4 -t 5.0.0 -t 6.0.0 --strip && prebuild -t 8.17.0 -t 10.23.0 -t 12.20.0 --strip",
1818
"dist:upload": "prebuild --upload-all",
1919
"test": "tree-sitter test"
2020
},
2121
"dependencies": {
22-
"nan": "^2.14.1",
23-
"prebuild-install": "^5.3.5"
22+
"nan": "^2.14.2",
23+
"prebuild-install": "^6.0.0"
2424
},
2525
"devDependencies": {
26-
"prebuild": "^10.0.0",
27-
"tree-sitter-cli": "^0.16.8"
26+
"prebuild": "^10.0.1",
27+
"tree-sitter-cli": "^0.17.3"
2828
},
2929
"files": [
3030
"src",
@@ -33,5 +33,13 @@
3333
"index.js",
3434
"package.json",
3535
"package-lock.json"
36+
],
37+
"tree-sitter": [
38+
{
39+
"scope": "source.lua",
40+
"file-types": [
41+
"lua"
42+
]
43+
}
3644
]
3745
}

src/node-types.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2192,6 +2192,10 @@
21922192
"type": "break_statement",
21932193
"named": true
21942194
},
2195+
{
2196+
"type": "comment",
2197+
"named": true
2198+
},
21952199
{
21962200
"type": "do",
21972201
"named": false

src/parser.c

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
66
#endif
77

8-
#define LANGUAGE_VERSION 11
8+
#define LANGUAGE_VERSION 12
99
#define STATE_COUNT 907
1010
#define LARGE_STATE_COUNT 113
1111
#define SYMBOL_COUNT 109
12-
#define ALIAS_COUNT 5
12+
#define ALIAS_COUNT 4
1313
#define TOKEN_COUNT 64
1414
#define EXTERNAL_TOKEN_COUNT 2
1515
#define FIELD_COUNT 1
@@ -128,7 +128,6 @@ enum {
128128
alias_sym_expression = 110,
129129
alias_sym_method = 111,
130130
alias_sym_property_identifier = 112,
131-
alias_sym_variable_declarator = 113,
132131
};
133132

134133
static const char *ts_symbol_names[] = {
@@ -245,7 +244,6 @@ static const char *ts_symbol_names[] = {
245244
[alias_sym_expression] = "expression",
246245
[alias_sym_method] = "method",
247246
[alias_sym_property_identifier] = "property_identifier",
248-
[alias_sym_variable_declarator] = "variable_declarator",
249247
};
250248

251249
static TSSymbol ts_symbol_map[] = {
@@ -362,7 +360,6 @@ static TSSymbol ts_symbol_map[] = {
362360
[alias_sym_expression] = alias_sym_expression,
363361
[alias_sym_method] = alias_sym_method,
364362
[alias_sym_property_identifier] = alias_sym_property_identifier,
365-
[alias_sym_variable_declarator] = alias_sym_variable_declarator,
366363
};
367364

368365
static const TSSymbolMetadata ts_symbol_metadata[] = {
@@ -818,10 +815,6 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
818815
.visible = true,
819816
.named = true,
820817
},
821-
[alias_sym_variable_declarator] = {
822-
.visible = true,
823-
.named = true,
824-
},
825818
};
826819

827820
enum {
@@ -851,10 +844,10 @@ static TSSymbol ts_alias_sequences[12][MAX_ALIAS_SEQUENCE_LENGTH] = {
851844
[2] = alias_sym_condition_expression,
852845
},
853846
[4] = {
854-
[1] = alias_sym_variable_declarator,
847+
[1] = sym__local_variable_declarator,
855848
},
856849
[5] = {
857-
[0] = alias_sym_variable_declarator,
850+
[0] = sym__local_variable_declarator,
858851
},
859852
[6] = {
860853
[2] = alias_sym_property_identifier,
@@ -876,6 +869,17 @@ static TSSymbol ts_alias_sequences[12][MAX_ALIAS_SEQUENCE_LENGTH] = {
876869
},
877870
};
878871

872+
static uint16_t ts_non_terminal_alias_map[] = {
873+
sym__variable_declarator, 2,
874+
sym__variable_declarator,
875+
sym__local_variable_declarator,
876+
sym__expression, 3,
877+
sym__expression,
878+
alias_sym_condition_expression,
879+
alias_sym_expression,
880+
0,
881+
};
882+
879883
static bool ts_lex(TSLexer *lexer, TSStateId state) {
880884
START_LEXER();
881885
eof = lexer->eof(lexer);
@@ -41040,23 +41044,15 @@ extern const TSLanguage *tree_sitter_lua(void) {
4104041044
.symbol_count = SYMBOL_COUNT,
4104141045
.alias_count = ALIAS_COUNT,
4104241046
.token_count = TOKEN_COUNT,
41043-
.large_state_count = LARGE_STATE_COUNT,
41047+
.external_token_count = EXTERNAL_TOKEN_COUNT,
41048+
.symbol_names = ts_symbol_names,
4104441049
.symbol_metadata = ts_symbol_metadata,
41045-
.parse_table = (const unsigned short *)ts_parse_table,
41046-
.small_parse_table = (const uint16_t *)ts_small_parse_table,
41047-
.small_parse_table_map = (const uint32_t *)ts_small_parse_table_map,
41050+
.parse_table = (const uint16_t *)ts_parse_table,
4104841051
.parse_actions = ts_parse_actions,
4104941052
.lex_modes = ts_lex_modes,
41050-
.symbol_names = ts_symbol_names,
41051-
.public_symbol_map = ts_symbol_map,
4105241053
.alias_sequences = (const TSSymbol *)ts_alias_sequences,
41053-
.field_count = FIELD_COUNT,
41054-
.field_names = ts_field_names,
41055-
.field_map_slices = (const TSFieldMapSlice *)ts_field_map_slices,
41056-
.field_map_entries = (const TSFieldMapEntry *)ts_field_map_entries,
4105741054
.max_alias_sequence_length = MAX_ALIAS_SEQUENCE_LENGTH,
4105841055
.lex_fn = ts_lex,
41059-
.external_token_count = EXTERNAL_TOKEN_COUNT,
4106041056
.external_scanner = {
4106141057
(const bool *)ts_external_scanner_states,
4106241058
ts_external_scanner_symbol_map,
@@ -41066,6 +41062,16 @@ extern const TSLanguage *tree_sitter_lua(void) {
4106641062
tree_sitter_lua_external_scanner_serialize,
4106741063
tree_sitter_lua_external_scanner_deserialize,
4106841064
},
41065+
.field_count = FIELD_COUNT,
41066+
.field_map_slices = (const TSFieldMapSlice *)ts_field_map_slices,
41067+
.field_map_entries = (const TSFieldMapEntry *)ts_field_map_entries,
41068+
.field_names = ts_field_names,
41069+
.large_state_count = LARGE_STATE_COUNT,
41070+
.small_parse_table = (const uint16_t *)ts_small_parse_table,
41071+
.small_parse_table_map = (const uint32_t *)ts_small_parse_table_map,
41072+
.public_symbol_map = ts_symbol_map,
41073+
.alias_map = ts_non_terminal_alias_map,
41074+
.state_count = STATE_COUNT,
4106941075
};
4107041076
return &language;
4107141077
}

src/tree_sitter/parser.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ typedef uint16_t TSStateId;
3535
typedef struct {
3636
bool visible : 1;
3737
bool named : 1;
38+
bool supertype: 1;
3839
} TSSymbolMetadata;
3940

4041
typedef struct TSLexer TSLexer;
@@ -119,6 +120,8 @@ struct TSLanguage {
119120
const uint16_t *small_parse_table;
120121
const uint32_t *small_parse_table_map;
121122
const TSSymbol *public_symbol_map;
123+
const uint16_t *alias_map;
124+
uint32_t state_count;
122125
};
123126

124127
/*

0 commit comments

Comments
 (0)