Skip to content

Commit

Permalink
src: Regenerate
Browse files Browse the repository at this point in the history
  • Loading branch information
adisbladis committed Aug 2, 2024
1 parent 3859c0d commit f0d7002
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 94 deletions.
150 changes: 61 additions & 89 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 @@ -16,7 +16,7 @@
#define MAX_ALIAS_SEQUENCE_LENGTH 6
#define PRODUCTION_ID_COUNT 41

enum {
enum ts_symbol_identifiers {
sym_keyword = 1,
sym_identifier = 2,
sym_integer_expression = 3,
Expand Down Expand Up @@ -784,7 +784,7 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
},
};

enum {
enum ts_field_identifiers {
field_alternative = 1,
field_argument = 2,
field_attr = 3,
Expand Down Expand Up @@ -1043,9 +1043,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '|') ADVANCE(40);
if (lookahead == '}') ADVANCE(122);
if (lookahead == '~') ADVANCE(12);
if (lookahead == '\t' ||
lookahead == '\n' ||
lookahead == '\r' ||
if (('\t' <= lookahead && lookahead <= '\r') ||
lookahead == ' ') SKIP(49)
if (('1' <= lookahead && lookahead <= '9')) ADVANCE(111);
if (('A' <= lookahead && lookahead <= 'Z') ||
Expand Down Expand Up @@ -1073,9 +1071,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '?') ADVANCE(124);
if (lookahead == '|') ADVANCE(40);
if (lookahead == '}') ADVANCE(122);
if (lookahead == '\t' ||
lookahead == '\n' ||
lookahead == '\r' ||
if (('\t' <= lookahead && lookahead <= '\r') ||
lookahead == ' ') SKIP(1)
if (('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' ||
Expand All @@ -1096,9 +1092,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == 'w') ADVANCE(99);
if (lookahead == '{') ADVANCE(121);
if (lookahead == '}') ADVANCE(122);
if (lookahead == '\t' ||
lookahead == '\n' ||
lookahead == '\r' ||
if (('\t' <= lookahead && lookahead <= '\r') ||
lookahead == ' ') SKIP(2)
if (('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' ||
Expand All @@ -1109,9 +1103,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '.') ADVANCE(10);
if (lookahead == '/') ADVANCE(7);
if (lookahead == '}') ADVANCE(122);
if (lookahead == '\t' ||
lookahead == '\n' ||
lookahead == '\r' ||
if (('\t' <= lookahead && lookahead <= '\r') ||
lookahead == ' ') SKIP(3)
if (('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' ||
Expand Down Expand Up @@ -1327,9 +1319,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '|') ADVANCE(40);
if (lookahead == '}') ADVANCE(122);
if (lookahead == '~') ADVANCE(12);
if (lookahead == '\t' ||
lookahead == '\n' ||
lookahead == '\r' ||
if (('\t' <= lookahead && lookahead <= '\r') ||
lookahead == ' ') SKIP(49)
if (('1' <= lookahead && lookahead <= '9')) ADVANCE(111);
if (('A' <= lookahead && lookahead <= 'Z') ||
Expand Down Expand Up @@ -1366,9 +1356,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '{') ADVANCE(121);
if (lookahead == '}') ADVANCE(122);
if (lookahead == '~') ADVANCE(12);
if (lookahead == '\t' ||
lookahead == '\n' ||
lookahead == '\r' ||
if (('\t' <= lookahead && lookahead <= '\r') ||
lookahead == ' ') SKIP(51)
if (('1' <= lookahead && lookahead <= '9')) ADVANCE(111);
if (('A' <= lookahead && lookahead <= 'Z') ||
Expand Down Expand Up @@ -1403,9 +1391,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '{') ADVANCE(121);
if (lookahead == '}') ADVANCE(122);
if (lookahead == '~') ADVANCE(12);
if (lookahead == '\t' ||
lookahead == '\n' ||
lookahead == '\r' ||
if (('\t' <= lookahead && lookahead <= '\r') ||
lookahead == ' ') SKIP(51)
if (('1' <= lookahead && lookahead <= '9')) ADVANCE(111);
if (('A' <= lookahead && lookahead <= 'Z') ||
Expand Down Expand Up @@ -1448,9 +1434,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '|') ADVANCE(40);
if (lookahead == '}') ADVANCE(122);
if (lookahead == '~') ADVANCE(12);
if (lookahead == '\t' ||
lookahead == '\n' ||
lookahead == '\r' ||
if (('\t' <= lookahead && lookahead <= '\r') ||
lookahead == ' ') SKIP(52)
if (('1' <= lookahead && lookahead <= '9')) ADVANCE(111);
if (('A' <= lookahead && lookahead <= 'Z') ||
Expand Down Expand Up @@ -1494,9 +1478,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '|') ADVANCE(40);
if (lookahead == '}') ADVANCE(122);
if (lookahead == '~') ADVANCE(12);
if (lookahead == '\t' ||
lookahead == '\n' ||
lookahead == '\r' ||
if (('\t' <= lookahead && lookahead <= '\r') ||
lookahead == ' ') SKIP(54)
if (('1' <= lookahead && lookahead <= '9')) ADVANCE(111);
if (('A' <= lookahead && lookahead <= 'Z') ||
Expand Down Expand Up @@ -1539,9 +1521,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '|') ADVANCE(40);
if (lookahead == '}') ADVANCE(122);
if (lookahead == '~') ADVANCE(12);
if (lookahead == '\t' ||
lookahead == '\n' ||
lookahead == '\r' ||
if (('\t' <= lookahead && lookahead <= '\r') ||
lookahead == ' ') SKIP(54)
if (('1' <= lookahead && lookahead <= '9')) ADVANCE(111);
if (('A' <= lookahead && lookahead <= 'Z') ||
Expand Down Expand Up @@ -1575,9 +1555,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == 'w') ADVANCE(28);
if (lookahead == '|') ADVANCE(40);
if (lookahead == '}') ADVANCE(122);
if (lookahead == '\t' ||
lookahead == '\n' ||
lookahead == '\r' ||
if (('\t' <= lookahead && lookahead <= '\r') ||
lookahead == ' ') SKIP(56)
END_STATE();
case 56:
Expand Down Expand Up @@ -1608,9 +1586,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == 'w') ADVANCE(28);
if (lookahead == '|') ADVANCE(40);
if (lookahead == '}') ADVANCE(122);
if (lookahead == '\t' ||
lookahead == '\n' ||
lookahead == '\r' ||
if (('\t' <= lookahead && lookahead <= '\r') ||
lookahead == ' ') SKIP(56)
END_STATE();
case 57:
Expand Down Expand Up @@ -1639,9 +1615,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == 'w') ADVANCE(28);
if (lookahead == '|') ADVANCE(40);
if (lookahead == '}') ADVANCE(122);
if (lookahead == '\t' ||
lookahead == '\n' ||
lookahead == '\r' ||
if (('\t' <= lookahead && lookahead <= '\r') ||
lookahead == ' ') SKIP(57)
END_STATE();
case 58:
Expand Down Expand Up @@ -2480,9 +2454,7 @@ static bool ts_lex_keywords(TSLexer *lexer, TSStateId state) {
if (lookahead == 'r') ADVANCE(5);
if (lookahead == 't') ADVANCE(6);
if (lookahead == 'w') ADVANCE(7);
if (lookahead == '\t' ||
lookahead == '\n' ||
lookahead == '\r' ||
if (('\t' <= lookahead && lookahead <= '\r') ||
lookahead == ' ') SKIP(0)
END_STATE();
case 1:
Expand Down Expand Up @@ -3130,50 +3102,6 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = {
[538] = {.lex_state = 0},
};

enum {
ts_external_token_string_fragment = 0,
ts_external_token__indented_string_fragment = 1,
ts_external_token__path_start = 2,
ts_external_token_path_fragment = 3,
ts_external_token_dollar_escape = 4,
ts_external_token__indented_dollar_escape = 5,
};

static const TSSymbol ts_external_scanner_symbol_map[EXTERNAL_TOKEN_COUNT] = {
[ts_external_token_string_fragment] = sym_string_fragment,
[ts_external_token__indented_string_fragment] = sym__indented_string_fragment,
[ts_external_token__path_start] = sym__path_start,
[ts_external_token_path_fragment] = sym_path_fragment,
[ts_external_token_dollar_escape] = sym_dollar_escape,
[ts_external_token__indented_dollar_escape] = sym__indented_dollar_escape,
};

static const bool ts_external_scanner_states[6][EXTERNAL_TOKEN_COUNT] = {
[1] = {
[ts_external_token_string_fragment] = true,
[ts_external_token__indented_string_fragment] = true,
[ts_external_token__path_start] = true,
[ts_external_token_path_fragment] = true,
[ts_external_token_dollar_escape] = true,
[ts_external_token__indented_dollar_escape] = true,
},
[2] = {
[ts_external_token__path_start] = true,
},
[3] = {
[ts_external_token__path_start] = true,
[ts_external_token_path_fragment] = true,
},
[4] = {
[ts_external_token_string_fragment] = true,
[ts_external_token_dollar_escape] = true,
},
[5] = {
[ts_external_token__indented_string_fragment] = true,
[ts_external_token__indented_dollar_escape] = true,
},
};

static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
[0] = {
[ts_builtin_sym_end] = ACTIONS(1),
Expand Down Expand Up @@ -22290,6 +22218,50 @@ static const TSParseActionEntry ts_parse_actions[] = {
[1096] = {.entry = {.count = 1, .reusable = true}}, SHIFT(452),
};

enum ts_external_scanner_symbol_identifiers {
ts_external_token_string_fragment = 0,
ts_external_token__indented_string_fragment = 1,
ts_external_token__path_start = 2,
ts_external_token_path_fragment = 3,
ts_external_token_dollar_escape = 4,
ts_external_token__indented_dollar_escape = 5,
};

static const TSSymbol ts_external_scanner_symbol_map[EXTERNAL_TOKEN_COUNT] = {
[ts_external_token_string_fragment] = sym_string_fragment,
[ts_external_token__indented_string_fragment] = sym__indented_string_fragment,
[ts_external_token__path_start] = sym__path_start,
[ts_external_token_path_fragment] = sym_path_fragment,
[ts_external_token_dollar_escape] = sym_dollar_escape,
[ts_external_token__indented_dollar_escape] = sym__indented_dollar_escape,
};

static const bool ts_external_scanner_states[6][EXTERNAL_TOKEN_COUNT] = {
[1] = {
[ts_external_token_string_fragment] = true,
[ts_external_token__indented_string_fragment] = true,
[ts_external_token__path_start] = true,
[ts_external_token_path_fragment] = true,
[ts_external_token_dollar_escape] = true,
[ts_external_token__indented_dollar_escape] = true,
},
[2] = {
[ts_external_token__path_start] = true,
},
[3] = {
[ts_external_token__path_start] = true,
[ts_external_token_path_fragment] = true,
},
[4] = {
[ts_external_token_string_fragment] = true,
[ts_external_token_dollar_escape] = true,
},
[5] = {
[ts_external_token__indented_string_fragment] = true,
[ts_external_token__indented_dollar_escape] = 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 f0d7002

Please sign in to comment.