Skip to content

Commit

Permalink
Update tree-sitter-cli to 0.20.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stsewd committed Aug 1, 2021
1 parent 894b61d commit 9e6a10c
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
- run: echo ./node_modules/.bin/ >> $GITHUB_PATH
- run: npm ci
- run: make test
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
build:
tree-sitter generate
npm run build

test: build
tree-sitter test
npm run test

serve: build
tree-sitter build-wasm
tree-sitter web-ui
npm run wasm
npm run web

release: build format
tree-sitter build-wasm
npm run wasm

format:
clang-format -i \
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
"scripts": {
"test": "tree-sitter test",
"build": "tree-sitter generate",
"wasm": "tree-sitter build-wasm",
"web": "tree-sitter web-ui"
"wasm": "tree-sitter build-wasm --docker",
"web": "tree-sitter web-ui",
"parse": "tree-sitter parse"
},
"repository": {
"type": "git",
Expand All @@ -26,6 +27,6 @@
"nan": "^2.14.2"
},
"devDependencies": {
"tree-sitter-cli": "^0.19.4"
"tree-sitter-cli": "^0.20.0"
}
}
34 changes: 17 additions & 17 deletions src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ enum {
aux_sym_source_repeat1 = 12,
};

static const char *ts_symbol_names[] = {
static const char * const ts_symbol_names[] = {
[ts_builtin_sym_end] = "end",
[anon_sym_COLON] = ":",
[anon_sym_LPAREN] = "(",
Expand All @@ -47,7 +47,7 @@ static const char *ts_symbol_names[] = {
[aux_sym_source_repeat1] = "source_repeat1",
};

static TSSymbol ts_symbol_map[] = {
static const TSSymbol ts_symbol_map[] = {
[ts_builtin_sym_end] = ts_builtin_sym_end,
[anon_sym_COLON] = anon_sym_COLON,
[anon_sym_LPAREN] = anon_sym_LPAREN,
Expand Down Expand Up @@ -118,11 +118,11 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
},
};

static TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = {
static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = {
[0] = {0},
};

static uint16_t ts_non_terminal_alias_map[] = {
static const uint16_t ts_non_terminal_alias_map[] = {
0,
};

Expand Down Expand Up @@ -192,7 +192,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
}
}

static TSLexMode ts_lex_modes[STATE_COUNT] = {
static const TSLexMode ts_lex_modes[STATE_COUNT] = {
[0] = {.lex_state = 0, .external_lex_state = 1},
[1] = {.lex_state = 0, .external_lex_state = 1},
[2] = {.lex_state = 0, .external_lex_state = 1},
Expand All @@ -212,19 +212,19 @@ enum {
ts_external_token__text = 1,
};

static TSSymbol ts_external_scanner_symbol_map[EXTERNAL_TOKEN_COUNT] = {
static const TSSymbol ts_external_scanner_symbol_map[EXTERNAL_TOKEN_COUNT] = {
[ts_external_token_name] = sym_name,
[ts_external_token__text] = sym__text,
};

static bool ts_external_scanner_states[2][EXTERNAL_TOKEN_COUNT] = {
static const bool ts_external_scanner_states[2][EXTERNAL_TOKEN_COUNT] = {
[1] = {
[ts_external_token_name] = true,
[ts_external_token__text] = true,
},
};

static uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
[0] = {
[ts_builtin_sym_end] = ACTIONS(1),
[anon_sym_COLON] = ACTIONS(1),
Expand Down Expand Up @@ -265,7 +265,7 @@ static uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
},
};

static uint16_t ts_small_parse_table[] = {
static const uint16_t ts_small_parse_table[] = {
[0] = 4,
ACTIONS(23), 1,
anon_sym_COLON,
Expand Down Expand Up @@ -324,7 +324,7 @@ static uint16_t ts_small_parse_table[] = {
sym___whitespace,
};

static uint32_t ts_small_parse_table_map[] = {
static const uint32_t ts_small_parse_table_map[] = {
[SMALL_STATE(4)] = 0,
[SMALL_STATE(5)] = 14,
[SMALL_STATE(6)] = 24,
Expand All @@ -335,7 +335,7 @@ static uint32_t ts_small_parse_table_map[] = {
[SMALL_STATE(11)] = 66,
};

static TSParseActionEntry ts_parse_actions[] = {
static const TSParseActionEntry ts_parse_actions[] = {
[0] = {.entry = {.count = 0, .reusable = false}},
[1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(),
[3] = {.entry = {.count = 1, .reusable = true}}, SHIFT_EXTRA(),
Expand Down Expand Up @@ -373,7 +373,7 @@ void tree_sitter_comment_external_scanner_deserialize(void *, const char *, unsi
#endif

extern const TSLanguage *tree_sitter_comment(void) {
static TSLanguage language = {
static const TSLanguage language = {
.version = LANGUAGE_VERSION,
.symbol_count = SYMBOL_COUNT,
.alias_count = ALIAS_COUNT,
Expand All @@ -384,19 +384,19 @@ extern const TSLanguage *tree_sitter_comment(void) {
.production_id_count = PRODUCTION_ID_COUNT,
.field_count = FIELD_COUNT,
.max_alias_sequence_length = MAX_ALIAS_SEQUENCE_LENGTH,
.parse_table = (const uint16_t *)ts_parse_table,
.small_parse_table = (const uint16_t *)ts_small_parse_table,
.small_parse_table_map = (const uint32_t *)ts_small_parse_table_map,
.parse_table = &ts_parse_table[0][0],
.small_parse_table = ts_small_parse_table,
.small_parse_table_map = ts_small_parse_table_map,
.parse_actions = ts_parse_actions,
.symbol_names = ts_symbol_names,
.symbol_metadata = ts_symbol_metadata,
.public_symbol_map = ts_symbol_map,
.alias_map = ts_non_terminal_alias_map,
.alias_sequences = (const TSSymbol *)ts_alias_sequences,
.alias_sequences = &ts_alias_sequences[0][0],
.lex_modes = ts_lex_modes,
.lex_fn = ts_lex,
.external_scanner = {
(const bool *)ts_external_scanner_states,
&ts_external_scanner_states[0][0],
ts_external_scanner_symbol_map,
tree_sitter_comment_external_scanner_create,
tree_sitter_comment_external_scanner_destroy,
Expand Down
4 changes: 2 additions & 2 deletions src/tree_sitter/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ struct TSLanguage {
const uint16_t *small_parse_table;
const uint32_t *small_parse_table_map;
const TSParseActionEntry *parse_actions;
const char **symbol_names;
const char **field_names;
const char * const *symbol_names;
const char * const *field_names;
const TSFieldMapSlice *field_map_slices;
const TSFieldMapEntry *field_map_entries;
const TSSymbolMetadata *symbol_metadata;
Expand Down
Binary file modified tree-sitter-comment.wasm
Binary file not shown.

0 comments on commit 9e6a10c

Please sign in to comment.