Skip to content

Commit

Permalink
build(dep): bump tree-sitter -> v0.21.0
Browse files Browse the repository at this point in the history
  • Loading branch information
6cdh committed Mar 12, 2024
1 parent e4ba1a9 commit 6cdabb1
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 33 deletions.
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@
"author": "6cdh",
"license": "MIT",
"dependencies": {
"nan": "^2.15.0"
},
"devDependencies": {
"tree-sitter-cli": "^0.20.6",
"typescript": "^4.8.4",
"typescript-language-server": "^2.1.0"
"nan": "^2.19.0"
},
"tree-sitter": [
{
Expand All @@ -24,5 +19,8 @@
"rkt"
]
}
]
],
"devDependencies": {
"tree-sitter-cli": "0.21.0"
}
}
27 changes: 27 additions & 0 deletions pnpm-lock.yaml

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

13 changes: 8 additions & 5 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"members": [
{
"type": "PATTERN",
"value": "[ \\t\\n\\v\\f\\r\\u{0085}\\u{00A0}\\u{1680}\\u{2000}-\\u{200A}\\u{2028}\\u{2029}\\u{202F}\\u{205F}\\u{3000}]+"
"value": "[ \\t\\n\\v\\f\\r\\u{0085}\\u{00A0}\\u{1680}\\u{2000}-\\u{200A}\\u{2028}\\u{2029}\\u{202F}\\u{205F}\\u{3000}]+",
"flags": "u"
},
{
"type": "SYMBOL",
Expand Down Expand Up @@ -7170,7 +7171,8 @@
"members": [
{
"type": "PATTERN",
"value": "[^# \\t\\n\\v\\f\\r\\u{0085}\\u{00A0}\\u{1680}\\u{2000}-\\u{200A}\\u{2028}\\u{2029}\\u{202F}\\u{205F}\\u{3000}\\u{FEFF}(){}\",'`;\\[\\]\\|\\\\]"
"value": "[^# \\t\\n\\v\\f\\r\\u{0085}\\u{00A0}\\u{1680}\\u{2000}-\\u{200A}\\u{2028}\\u{2029}\\u{202F}\\u{205F}\\u{3000}\\u{FEFF}(){}\",'`;\\[\\]\\|\\\\]",
"flags": "u"
},
{
"type": "STRING",
Expand All @@ -7193,7 +7195,8 @@
"members": [
{
"type": "PATTERN",
"value": "[^ \\t\\n\\v\\f\\r\\u{0085}\\u{00A0}\\u{1680}\\u{2000}-\\u{200A}\\u{2028}\\u{2029}\\u{202F}\\u{205F}\\u{3000}\\u{FEFF}(){}\",'`;\\[\\]\\|\\\\]"
"value": "[^ \\t\\n\\v\\f\\r\\u{0085}\\u{00A0}\\u{1680}\\u{2000}-\\u{200A}\\u{2028}\\u{2029}\\u{202F}\\u{205F}\\u{3000}\\u{FEFF}(){}\",'`;\\[\\]\\|\\\\]",
"flags": "u"
},
{
"type": "PATTERN",
Expand Down Expand Up @@ -7227,7 +7230,8 @@
"members": [
{
"type": "PATTERN",
"value": "[^ \\t\\n\\v\\f\\r\\u{0085}\\u{00A0}\\u{1680}\\u{2000}-\\u{200A}\\u{2028}\\u{2029}\\u{202F}\\u{205F}\\u{3000}\\u{FEFF}(){}\",'`;\\[\\]\\|\\\\]"
"value": "[^ \\t\\n\\v\\f\\r\\u{0085}\\u{00A0}\\u{1680}\\u{2000}-\\u{200A}\\u{2028}\\u{2029}\\u{202F}\\u{205F}\\u{3000}\\u{FEFF}(){}\",'`;\\[\\]\\|\\\\]",
"flags": "u"
},
{
"type": "PATTERN",
Expand Down Expand Up @@ -7698,4 +7702,3 @@
"inline": [],
"supertypes": []
}

32 changes: 16 additions & 16 deletions src/parser.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <tree_sitter/parser.h>
#include "tree_sitter/parser.h"

#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
Expand All @@ -24,7 +24,7 @@
#define MAX_ALIAS_SEQUENCE_LENGTH 5
#define PRODUCTION_ID_COUNT 1

enum {
enum ts_symbol_identifiers {
aux_sym__skip_token1 = 1,
sym_dot = 2,
aux_sym_comment_token1 = 3,
Expand Down Expand Up @@ -4934,20 +4934,6 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = {
[256] = {.lex_state = 0},
};

enum {
ts_external_token__here_string_body = 0,
};

static const TSSymbol ts_external_scanner_symbol_map[EXTERNAL_TOKEN_COUNT] = {
[ts_external_token__here_string_body] = sym__here_string_body,
};

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

static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
[0] = {
[ts_builtin_sym_end] = ACTIONS(1),
Expand Down Expand Up @@ -16206,6 +16192,20 @@ static const TSParseActionEntry ts_parse_actions[] = {
[1008] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(),
};

enum ts_external_scanner_symbol_identifiers {
ts_external_token__here_string_body = 0,
};

static const TSSymbol ts_external_scanner_symbol_map[EXTERNAL_TOKEN_COUNT] = {
[ts_external_token__here_string_body] = sym__here_string_body,
};

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

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
16 changes: 11 additions & 5 deletions src/tree_sitter/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ extern "C" {
#define ts_builtin_sym_end 0
#define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024

typedef uint16_t TSStateId;

#ifndef TREE_SITTER_API_H_
typedef uint16_t TSStateId;
typedef uint16_t TSSymbol;
typedef uint16_t TSFieldId;
typedef struct TSLanguage TSLanguage;
Expand Down Expand Up @@ -130,9 +129,16 @@ struct TSLanguage {
* Lexer Macros
*/

#ifdef _MSC_VER
#define UNUSED __pragma(warning(suppress : 4101))
#else
#define UNUSED __attribute__((unused))
#endif

#define START_LEXER() \
bool result = false; \
bool skip = false; \
UNUSED \
bool eof = false; \
int32_t lookahead; \
goto start; \
Expand Down Expand Up @@ -166,7 +172,7 @@ struct TSLanguage {
* Parse Table Macros
*/

#define SMALL_STATE(id) id - LARGE_STATE_COUNT
#define SMALL_STATE(id) ((id) - LARGE_STATE_COUNT)

#define STATE(id) id

Expand All @@ -176,15 +182,15 @@ struct TSLanguage {
{{ \
.shift = { \
.type = TSParseActionTypeShift, \
.state = state_value \
.state = (state_value) \
} \
}}

#define SHIFT_REPEAT(state_value) \
{{ \
.shift = { \
.type = TSParseActionTypeShift, \
.state = state_value, \
.state = (state_value), \
.repetition = true \
} \
}}
Expand Down

0 comments on commit 6cdabb1

Please sign in to comment.