Files
zed-p8/grammars/p8-cart/src/parser.c
T
kistaro 7557a34c89 Cart grammar: tolerate leading blank lines before the magic header
`extras: $ => []` in the cart grammar made the parser fail at byte 0
on any whitespace-only or empty line before `pico-8 cartridge //...`.
Real PICO-8 carts always start with the header at byte 0 so this
rarely surfaced in production, but it ( a ) broke the `tree-sitter
test` corpus harness, which prepends a newline to each fixture, and
( b ) would mis-flag a hand-edited cart that gained an accidental
blank line up top.

Fix: prefix the `cartridge` rule with `repeat($._blank_line)` and add
a hidden `_blank_line` token matching `[ \t]*\n`. Junk content before
the header ( a non-blank, non-magic line ) still produces an ERROR.

Restores the test corpus that was dropped in v0.1 ( previously failing
on this same edge case ) and adds a fixture for the unknown_section
fallback while the corpus is being rebuilt.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 12:56:59 -07:00

1837 lines
58 KiB
C

#include "tree_sitter/parser.h"
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif
#define LANGUAGE_VERSION 14
#define STATE_COUNT 36
#define LARGE_STATE_COUNT 13
#define SYMBOL_COUNT 30
#define ALIAS_COUNT 0
#define TOKEN_COUNT 14
#define EXTERNAL_TOKEN_COUNT 0
#define FIELD_COUNT 0
#define MAX_ALIAS_SEQUENCE_LENGTH 4
#define PRODUCTION_ID_COUNT 1
enum ts_symbol_identifiers {
sym__blank_line = 1,
sym_header = 2,
sym_version = 3,
sym_lua_marker = 4,
sym_gfx_marker = 5,
sym_gff_marker = 6,
sym_label_marker = 7,
sym_map_marker = 8,
sym_sfx_marker = 9,
sym_music_marker = 10,
sym_section_marker = 11,
aux_sym_line_token1 = 12,
aux_sym_line_token2 = 13,
sym_cartridge = 14,
sym_section = 15,
sym_lua_section = 16,
sym_gfx_section = 17,
sym_gff_section = 18,
sym_label_section = 19,
sym_map_section = 20,
sym_sfx_section = 21,
sym_music_section = 22,
sym_unknown_section = 23,
sym_lua_content = 24,
sym_body = 25,
sym_line = 26,
aux_sym_cartridge_repeat1 = 27,
aux_sym_cartridge_repeat2 = 28,
aux_sym_lua_content_repeat1 = 29,
};
static const char * const ts_symbol_names[] = {
[ts_builtin_sym_end] = "end",
[sym__blank_line] = "_blank_line",
[sym_header] = "header",
[sym_version] = "version",
[sym_lua_marker] = "lua_marker",
[sym_gfx_marker] = "gfx_marker",
[sym_gff_marker] = "gff_marker",
[sym_label_marker] = "label_marker",
[sym_map_marker] = "map_marker",
[sym_sfx_marker] = "sfx_marker",
[sym_music_marker] = "music_marker",
[sym_section_marker] = "section_marker",
[aux_sym_line_token1] = "line_token1",
[aux_sym_line_token2] = "line_token2",
[sym_cartridge] = "cartridge",
[sym_section] = "section",
[sym_lua_section] = "lua_section",
[sym_gfx_section] = "gfx_section",
[sym_gff_section] = "gff_section",
[sym_label_section] = "label_section",
[sym_map_section] = "map_section",
[sym_sfx_section] = "sfx_section",
[sym_music_section] = "music_section",
[sym_unknown_section] = "unknown_section",
[sym_lua_content] = "lua_content",
[sym_body] = "body",
[sym_line] = "line",
[aux_sym_cartridge_repeat1] = "cartridge_repeat1",
[aux_sym_cartridge_repeat2] = "cartridge_repeat2",
[aux_sym_lua_content_repeat1] = "lua_content_repeat1",
};
static const TSSymbol ts_symbol_map[] = {
[ts_builtin_sym_end] = ts_builtin_sym_end,
[sym__blank_line] = sym__blank_line,
[sym_header] = sym_header,
[sym_version] = sym_version,
[sym_lua_marker] = sym_lua_marker,
[sym_gfx_marker] = sym_gfx_marker,
[sym_gff_marker] = sym_gff_marker,
[sym_label_marker] = sym_label_marker,
[sym_map_marker] = sym_map_marker,
[sym_sfx_marker] = sym_sfx_marker,
[sym_music_marker] = sym_music_marker,
[sym_section_marker] = sym_section_marker,
[aux_sym_line_token1] = aux_sym_line_token1,
[aux_sym_line_token2] = aux_sym_line_token2,
[sym_cartridge] = sym_cartridge,
[sym_section] = sym_section,
[sym_lua_section] = sym_lua_section,
[sym_gfx_section] = sym_gfx_section,
[sym_gff_section] = sym_gff_section,
[sym_label_section] = sym_label_section,
[sym_map_section] = sym_map_section,
[sym_sfx_section] = sym_sfx_section,
[sym_music_section] = sym_music_section,
[sym_unknown_section] = sym_unknown_section,
[sym_lua_content] = sym_lua_content,
[sym_body] = sym_body,
[sym_line] = sym_line,
[aux_sym_cartridge_repeat1] = aux_sym_cartridge_repeat1,
[aux_sym_cartridge_repeat2] = aux_sym_cartridge_repeat2,
[aux_sym_lua_content_repeat1] = aux_sym_lua_content_repeat1,
};
static const TSSymbolMetadata ts_symbol_metadata[] = {
[ts_builtin_sym_end] = {
.visible = false,
.named = true,
},
[sym__blank_line] = {
.visible = false,
.named = true,
},
[sym_header] = {
.visible = true,
.named = true,
},
[sym_version] = {
.visible = true,
.named = true,
},
[sym_lua_marker] = {
.visible = true,
.named = true,
},
[sym_gfx_marker] = {
.visible = true,
.named = true,
},
[sym_gff_marker] = {
.visible = true,
.named = true,
},
[sym_label_marker] = {
.visible = true,
.named = true,
},
[sym_map_marker] = {
.visible = true,
.named = true,
},
[sym_sfx_marker] = {
.visible = true,
.named = true,
},
[sym_music_marker] = {
.visible = true,
.named = true,
},
[sym_section_marker] = {
.visible = true,
.named = true,
},
[aux_sym_line_token1] = {
.visible = false,
.named = false,
},
[aux_sym_line_token2] = {
.visible = false,
.named = false,
},
[sym_cartridge] = {
.visible = true,
.named = true,
},
[sym_section] = {
.visible = true,
.named = true,
},
[sym_lua_section] = {
.visible = true,
.named = true,
},
[sym_gfx_section] = {
.visible = true,
.named = true,
},
[sym_gff_section] = {
.visible = true,
.named = true,
},
[sym_label_section] = {
.visible = true,
.named = true,
},
[sym_map_section] = {
.visible = true,
.named = true,
},
[sym_sfx_section] = {
.visible = true,
.named = true,
},
[sym_music_section] = {
.visible = true,
.named = true,
},
[sym_unknown_section] = {
.visible = true,
.named = true,
},
[sym_lua_content] = {
.visible = true,
.named = true,
},
[sym_body] = {
.visible = true,
.named = true,
},
[sym_line] = {
.visible = true,
.named = true,
},
[aux_sym_cartridge_repeat1] = {
.visible = false,
.named = false,
},
[aux_sym_cartridge_repeat2] = {
.visible = false,
.named = false,
},
[aux_sym_lua_content_repeat1] = {
.visible = false,
.named = false,
},
};
static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = {
[0] = {0},
};
static const uint16_t ts_non_terminal_alias_map[] = {
0,
};
static const TSStateId ts_primary_state_ids[STATE_COUNT] = {
[0] = 0,
[1] = 1,
[2] = 2,
[3] = 3,
[4] = 4,
[5] = 5,
[6] = 6,
[7] = 7,
[8] = 8,
[9] = 9,
[10] = 10,
[11] = 11,
[12] = 12,
[13] = 13,
[14] = 14,
[15] = 15,
[16] = 16,
[17] = 17,
[18] = 18,
[19] = 19,
[20] = 20,
[21] = 21,
[22] = 22,
[23] = 23,
[24] = 24,
[25] = 25,
[26] = 26,
[27] = 27,
[28] = 28,
[29] = 29,
[30] = 30,
[31] = 31,
[32] = 32,
[33] = 33,
[34] = 34,
[35] = 35,
};
static bool ts_lex(TSLexer *lexer, TSStateId state) {
START_LEXER();
eof = lexer->eof(lexer);
switch (state) {
case 0:
if (eof) ADVANCE(71);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(84);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 1:
if (lookahead == '\n') ADVANCE(82);
if (lookahead == '_') ADVANCE(1);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 2:
if (lookahead == '\n') ADVANCE(77);
if (lookahead == '_') ADVANCE(1);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 3:
if (lookahead == '\n') ADVANCE(76);
if (lookahead == '_') ADVANCE(1);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 4:
if (lookahead == '\n') ADVANCE(75);
if (lookahead == '_') ADVANCE(1);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 5:
if (lookahead == '\n') ADVANCE(79);
if (lookahead == '_') ADVANCE(1);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 6:
if (lookahead == '\n') ADVANCE(80);
if (lookahead == '_') ADVANCE(1);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 7:
if (lookahead == '\n') ADVANCE(78);
if (lookahead == '_') ADVANCE(1);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 8:
if (lookahead == '\n') ADVANCE(81);
if (lookahead == '_') ADVANCE(1);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 9:
if (lookahead == '\n') ADVANCE(72);
if (lookahead == '\t' ||
lookahead == ' ') ADVANCE(9);
END_STATE();
case 10:
if (lookahead == '\n') ADVANCE(74);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(10);
END_STATE();
case 11:
if (lookahead == '\n') ADVANCE(73);
if (lookahead != 0) ADVANCE(11);
END_STATE();
case 12:
if (lookahead == ' ') ADVANCE(16);
END_STATE();
case 13:
if (lookahead == ' ') ADVANCE(51);
END_STATE();
case 14:
if (lookahead == '-') ADVANCE(17);
END_STATE();
case 15:
if (lookahead == '/') ADVANCE(11);
END_STATE();
case 16:
if (lookahead == '/') ADVANCE(15);
END_STATE();
case 17:
if (lookahead == '8') ADVANCE(13);
END_STATE();
case 18:
if (lookahead == '_') ADVANCE(55);
END_STATE();
case 19:
if (lookahead == '_') ADVANCE(1);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 20:
if (lookahead == '_') ADVANCE(19);
if (lookahead == 'a') ADVANCE(23);
if (lookahead == 'u') ADVANCE(22);
if (('0' <= lookahead && lookahead <= '9') ||
('b' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 21:
if (lookahead == '_') ADVANCE(19);
if (lookahead == 'a') ADVANCE(31);
if (lookahead == 'u') ADVANCE(32);
if (('0' <= lookahead && lookahead <= '9') ||
('b' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 22:
if (lookahead == '_') ADVANCE(19);
if (lookahead == 'a') ADVANCE(40);
if (('0' <= lookahead && lookahead <= '9') ||
('b' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 23:
if (lookahead == '_') ADVANCE(19);
if (lookahead == 'b') ADVANCE(25);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 24:
if (lookahead == '_') ADVANCE(19);
if (lookahead == 'c') ADVANCE(48);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 25:
if (lookahead == '_') ADVANCE(19);
if (lookahead == 'e') ADVANCE(30);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 26:
if (lookahead == '_') ADVANCE(19);
if (lookahead == 'f') ADVANCE(28);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 27:
if (lookahead == '_') ADVANCE(19);
if (lookahead == 'f') ADVANCE(33);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 28:
if (lookahead == '_') ADVANCE(19);
if (lookahead == 'f') ADVANCE(36);
if (lookahead == 'x') ADVANCE(38);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 29:
if (lookahead == '_') ADVANCE(19);
if (lookahead == 'i') ADVANCE(24);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 30:
if (lookahead == '_') ADVANCE(19);
if (lookahead == 'l') ADVANCE(46);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 31:
if (lookahead == '_') ADVANCE(19);
if (lookahead == 'p') ADVANCE(42);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 32:
if (lookahead == '_') ADVANCE(19);
if (lookahead == 's') ADVANCE(29);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 33:
if (lookahead == '_') ADVANCE(19);
if (lookahead == 'x') ADVANCE(44);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 34:
if (lookahead == '_') ADVANCE(19);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 35:
if (lookahead == '_') ADVANCE(2);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 36:
if (lookahead == '_') ADVANCE(35);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 37:
if (lookahead == '_') ADVANCE(3);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 38:
if (lookahead == '_') ADVANCE(37);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 39:
if (lookahead == '_') ADVANCE(4);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 40:
if (lookahead == '_') ADVANCE(39);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 41:
if (lookahead == '_') ADVANCE(5);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 42:
if (lookahead == '_') ADVANCE(41);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 43:
if (lookahead == '_') ADVANCE(6);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 44:
if (lookahead == '_') ADVANCE(43);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 45:
if (lookahead == '_') ADVANCE(7);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 46:
if (lookahead == '_') ADVANCE(45);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 47:
if (lookahead == '_') ADVANCE(8);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 48:
if (lookahead == '_') ADVANCE(47);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 49:
if (lookahead == 'a') ADVANCE(64);
END_STATE();
case 50:
if (lookahead == 'c') ADVANCE(61);
END_STATE();
case 51:
if (lookahead == 'c') ADVANCE(49);
END_STATE();
case 52:
if (lookahead == 'd') ADVANCE(56);
END_STATE();
case 53:
if (lookahead == 'e') ADVANCE(63);
END_STATE();
case 54:
if (lookahead == 'e') ADVANCE(12);
END_STATE();
case 55:
if (lookahead == 'g') ADVANCE(26);
if (lookahead == 'l') ADVANCE(20);
if (lookahead == 'm') ADVANCE(21);
if (lookahead == 's') ADVANCE(27);
if (('a' <= lookahead && lookahead <= 'z')) ADVANCE(34);
END_STATE();
case 56:
if (lookahead == 'g') ADVANCE(54);
END_STATE();
case 57:
if (lookahead == 'i') ADVANCE(50);
END_STATE();
case 58:
if (lookahead == 'i') ADVANCE(52);
END_STATE();
case 59:
if (lookahead == 'i') ADVANCE(62);
END_STATE();
case 60:
if (lookahead == 'n') ADVANCE(68);
END_STATE();
case 61:
if (lookahead == 'o') ADVANCE(14);
END_STATE();
case 62:
if (lookahead == 'o') ADVANCE(60);
END_STATE();
case 63:
if (lookahead == 'r') ADVANCE(66);
END_STATE();
case 64:
if (lookahead == 'r') ADVANCE(67);
END_STATE();
case 65:
if (lookahead == 'r') ADVANCE(58);
END_STATE();
case 66:
if (lookahead == 's') ADVANCE(59);
END_STATE();
case 67:
if (lookahead == 't') ADVANCE(65);
END_STATE();
case 68:
if (lookahead == '\t' ||
lookahead == ' ') ADVANCE(69);
END_STATE();
case 69:
if (lookahead == '\t' ||
lookahead == ' ') ADVANCE(69);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(10);
END_STATE();
case 70:
if (eof) ADVANCE(71);
if (lookahead == '\n') ADVANCE(72);
if (lookahead == '_') ADVANCE(18);
if (lookahead == 'p') ADVANCE(57);
if (lookahead == 'v') ADVANCE(53);
if (lookahead == '\t' ||
lookahead == ' ') ADVANCE(9);
END_STATE();
case 71:
ACCEPT_TOKEN(ts_builtin_sym_end);
END_STATE();
case 72:
ACCEPT_TOKEN(sym__blank_line);
END_STATE();
case 73:
ACCEPT_TOKEN(sym_header);
END_STATE();
case 74:
ACCEPT_TOKEN(sym_version);
END_STATE();
case 75:
ACCEPT_TOKEN(sym_lua_marker);
END_STATE();
case 76:
ACCEPT_TOKEN(sym_gfx_marker);
END_STATE();
case 77:
ACCEPT_TOKEN(sym_gff_marker);
END_STATE();
case 78:
ACCEPT_TOKEN(sym_label_marker);
END_STATE();
case 79:
ACCEPT_TOKEN(sym_map_marker);
END_STATE();
case 80:
ACCEPT_TOKEN(sym_sfx_marker);
END_STATE();
case 81:
ACCEPT_TOKEN(sym_music_marker);
END_STATE();
case 82:
ACCEPT_TOKEN(sym_section_marker);
END_STATE();
case 83:
ACCEPT_TOKEN(aux_sym_line_token1);
END_STATE();
case 84:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(115);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 85:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(117);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 86:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(118);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 87:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(119);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 88:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(120);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 89:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(121);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 90:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(122);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 91:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(123);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 92:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(124);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 93:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(85);
if (lookahead == 'a') ADVANCE(96);
if (lookahead == 'u') ADVANCE(95);
if (('0' <= lookahead && lookahead <= '9') ||
('b' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 94:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(85);
if (lookahead == 'a') ADVANCE(104);
if (lookahead == 'u') ADVANCE(105);
if (('0' <= lookahead && lookahead <= '9') ||
('b' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 95:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(85);
if (lookahead == 'a') ADVANCE(110);
if (('0' <= lookahead && lookahead <= '9') ||
('b' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 96:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(85);
if (lookahead == 'b') ADVANCE(98);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 97:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(85);
if (lookahead == 'c') ADVANCE(114);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 98:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(85);
if (lookahead == 'e') ADVANCE(103);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 99:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(85);
if (lookahead == 'f') ADVANCE(101);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 100:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(85);
if (lookahead == 'f') ADVANCE(106);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 101:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(85);
if (lookahead == 'f') ADVANCE(108);
if (lookahead == 'x') ADVANCE(109);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 102:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(85);
if (lookahead == 'i') ADVANCE(97);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 103:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(85);
if (lookahead == 'l') ADVANCE(113);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 104:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(85);
if (lookahead == 'p') ADVANCE(111);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 105:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(85);
if (lookahead == 's') ADVANCE(102);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 106:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(85);
if (lookahead == 'x') ADVANCE(112);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 107:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(85);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 108:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(86);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 109:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(87);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 110:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(88);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 111:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(89);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 112:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(90);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 113:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(91);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 114:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == '_') ADVANCE(92);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 115:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead == 'g') ADVANCE(99);
if (lookahead == 'l') ADVANCE(93);
if (lookahead == 'm') ADVANCE(94);
if (lookahead == 's') ADVANCE(100);
if (('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 116:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(83);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 117:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(82);
if (lookahead == '_') ADVANCE(117);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 118:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(77);
if (lookahead == '_') ADVANCE(117);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 119:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(76);
if (lookahead == '_') ADVANCE(117);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 120:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(75);
if (lookahead == '_') ADVANCE(117);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 121:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(79);
if (lookahead == '_') ADVANCE(117);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 122:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(80);
if (lookahead == '_') ADVANCE(117);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 123:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(78);
if (lookahead == '_') ADVANCE(117);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
case 124:
ACCEPT_TOKEN(aux_sym_line_token2);
if (lookahead == '\n') ADVANCE(81);
if (lookahead == '_') ADVANCE(117);
if (('0' <= lookahead && lookahead <= '9') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(107);
if (lookahead != 0) ADVANCE(116);
END_STATE();
default:
return false;
}
}
static const TSLexMode ts_lex_modes[STATE_COUNT] = {
[0] = {.lex_state = 0},
[1] = {.lex_state = 70},
[2] = {.lex_state = 70},
[3] = {.lex_state = 70},
[4] = {.lex_state = 70},
[5] = {.lex_state = 0},
[6] = {.lex_state = 0},
[7] = {.lex_state = 0},
[8] = {.lex_state = 0},
[9] = {.lex_state = 0},
[10] = {.lex_state = 0},
[11] = {.lex_state = 0},
[12] = {.lex_state = 0},
[13] = {.lex_state = 0},
[14] = {.lex_state = 0},
[15] = {.lex_state = 0},
[16] = {.lex_state = 0},
[17] = {.lex_state = 0},
[18] = {.lex_state = 0},
[19] = {.lex_state = 0},
[20] = {.lex_state = 0},
[21] = {.lex_state = 0},
[22] = {.lex_state = 70},
[23] = {.lex_state = 0},
[24] = {.lex_state = 0},
[25] = {.lex_state = 0},
[26] = {.lex_state = 0},
[27] = {.lex_state = 0},
[28] = {.lex_state = 0},
[29] = {.lex_state = 0},
[30] = {.lex_state = 0},
[31] = {.lex_state = 0},
[32] = {.lex_state = 0},
[33] = {.lex_state = 0},
[34] = {.lex_state = 0},
[35] = {.lex_state = 0},
};
static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
[0] = {
[ts_builtin_sym_end] = ACTIONS(1),
[sym_lua_marker] = ACTIONS(1),
[sym_gfx_marker] = ACTIONS(1),
[sym_gff_marker] = ACTIONS(1),
[sym_label_marker] = ACTIONS(1),
[sym_map_marker] = ACTIONS(1),
[sym_sfx_marker] = ACTIONS(1),
[sym_music_marker] = ACTIONS(1),
[sym_section_marker] = ACTIONS(1),
[aux_sym_line_token1] = ACTIONS(1),
[aux_sym_line_token2] = ACTIONS(1),
},
[1] = {
[sym_cartridge] = STATE(35),
[sym_section] = STATE(8),
[sym_lua_section] = STATE(26),
[sym_gfx_section] = STATE(26),
[sym_gff_section] = STATE(26),
[sym_label_section] = STATE(26),
[sym_map_section] = STATE(26),
[sym_sfx_section] = STATE(26),
[sym_music_section] = STATE(26),
[sym_unknown_section] = STATE(26),
[aux_sym_cartridge_repeat1] = STATE(2),
[aux_sym_cartridge_repeat2] = STATE(8),
[ts_builtin_sym_end] = ACTIONS(3),
[sym__blank_line] = ACTIONS(5),
[sym_header] = ACTIONS(7),
[sym_version] = ACTIONS(9),
[sym_lua_marker] = ACTIONS(11),
[sym_gfx_marker] = ACTIONS(13),
[sym_gff_marker] = ACTIONS(15),
[sym_label_marker] = ACTIONS(17),
[sym_map_marker] = ACTIONS(19),
[sym_sfx_marker] = ACTIONS(21),
[sym_music_marker] = ACTIONS(23),
[sym_section_marker] = ACTIONS(25),
},
[2] = {
[sym_section] = STATE(6),
[sym_lua_section] = STATE(26),
[sym_gfx_section] = STATE(26),
[sym_gff_section] = STATE(26),
[sym_label_section] = STATE(26),
[sym_map_section] = STATE(26),
[sym_sfx_section] = STATE(26),
[sym_music_section] = STATE(26),
[sym_unknown_section] = STATE(26),
[aux_sym_cartridge_repeat1] = STATE(22),
[aux_sym_cartridge_repeat2] = STATE(6),
[ts_builtin_sym_end] = ACTIONS(27),
[sym__blank_line] = ACTIONS(29),
[sym_header] = ACTIONS(31),
[sym_version] = ACTIONS(33),
[sym_lua_marker] = ACTIONS(11),
[sym_gfx_marker] = ACTIONS(13),
[sym_gff_marker] = ACTIONS(15),
[sym_label_marker] = ACTIONS(17),
[sym_map_marker] = ACTIONS(19),
[sym_sfx_marker] = ACTIONS(21),
[sym_music_marker] = ACTIONS(23),
[sym_section_marker] = ACTIONS(25),
},
[3] = {
[sym_section] = STATE(6),
[sym_lua_section] = STATE(26),
[sym_gfx_section] = STATE(26),
[sym_gff_section] = STATE(26),
[sym_label_section] = STATE(26),
[sym_map_section] = STATE(26),
[sym_sfx_section] = STATE(26),
[sym_music_section] = STATE(26),
[sym_unknown_section] = STATE(26),
[aux_sym_cartridge_repeat2] = STATE(6),
[ts_builtin_sym_end] = ACTIONS(27),
[sym_version] = ACTIONS(33),
[sym_lua_marker] = ACTIONS(11),
[sym_gfx_marker] = ACTIONS(13),
[sym_gff_marker] = ACTIONS(15),
[sym_label_marker] = ACTIONS(17),
[sym_map_marker] = ACTIONS(19),
[sym_sfx_marker] = ACTIONS(21),
[sym_music_marker] = ACTIONS(23),
[sym_section_marker] = ACTIONS(25),
},
[4] = {
[sym_section] = STATE(9),
[sym_lua_section] = STATE(26),
[sym_gfx_section] = STATE(26),
[sym_gff_section] = STATE(26),
[sym_label_section] = STATE(26),
[sym_map_section] = STATE(26),
[sym_sfx_section] = STATE(26),
[sym_music_section] = STATE(26),
[sym_unknown_section] = STATE(26),
[aux_sym_cartridge_repeat2] = STATE(9),
[ts_builtin_sym_end] = ACTIONS(35),
[sym_version] = ACTIONS(37),
[sym_lua_marker] = ACTIONS(11),
[sym_gfx_marker] = ACTIONS(13),
[sym_gff_marker] = ACTIONS(15),
[sym_label_marker] = ACTIONS(17),
[sym_map_marker] = ACTIONS(19),
[sym_sfx_marker] = ACTIONS(21),
[sym_music_marker] = ACTIONS(23),
[sym_section_marker] = ACTIONS(25),
},
[5] = {
[sym_section] = STATE(9),
[sym_lua_section] = STATE(26),
[sym_gfx_section] = STATE(26),
[sym_gff_section] = STATE(26),
[sym_label_section] = STATE(26),
[sym_map_section] = STATE(26),
[sym_sfx_section] = STATE(26),
[sym_music_section] = STATE(26),
[sym_unknown_section] = STATE(26),
[aux_sym_cartridge_repeat2] = STATE(9),
[ts_builtin_sym_end] = ACTIONS(35),
[sym_lua_marker] = ACTIONS(11),
[sym_gfx_marker] = ACTIONS(13),
[sym_gff_marker] = ACTIONS(15),
[sym_label_marker] = ACTIONS(17),
[sym_map_marker] = ACTIONS(19),
[sym_sfx_marker] = ACTIONS(21),
[sym_music_marker] = ACTIONS(23),
[sym_section_marker] = ACTIONS(25),
},
[6] = {
[sym_section] = STATE(10),
[sym_lua_section] = STATE(26),
[sym_gfx_section] = STATE(26),
[sym_gff_section] = STATE(26),
[sym_label_section] = STATE(26),
[sym_map_section] = STATE(26),
[sym_sfx_section] = STATE(26),
[sym_music_section] = STATE(26),
[sym_unknown_section] = STATE(26),
[aux_sym_cartridge_repeat2] = STATE(10),
[ts_builtin_sym_end] = ACTIONS(35),
[sym_lua_marker] = ACTIONS(11),
[sym_gfx_marker] = ACTIONS(13),
[sym_gff_marker] = ACTIONS(15),
[sym_label_marker] = ACTIONS(17),
[sym_map_marker] = ACTIONS(19),
[sym_sfx_marker] = ACTIONS(21),
[sym_music_marker] = ACTIONS(23),
[sym_section_marker] = ACTIONS(25),
},
[7] = {
[sym_section] = STATE(6),
[sym_lua_section] = STATE(26),
[sym_gfx_section] = STATE(26),
[sym_gff_section] = STATE(26),
[sym_label_section] = STATE(26),
[sym_map_section] = STATE(26),
[sym_sfx_section] = STATE(26),
[sym_music_section] = STATE(26),
[sym_unknown_section] = STATE(26),
[aux_sym_cartridge_repeat2] = STATE(6),
[ts_builtin_sym_end] = ACTIONS(27),
[sym_lua_marker] = ACTIONS(11),
[sym_gfx_marker] = ACTIONS(13),
[sym_gff_marker] = ACTIONS(15),
[sym_label_marker] = ACTIONS(17),
[sym_map_marker] = ACTIONS(19),
[sym_sfx_marker] = ACTIONS(21),
[sym_music_marker] = ACTIONS(23),
[sym_section_marker] = ACTIONS(25),
},
[8] = {
[sym_section] = STATE(10),
[sym_lua_section] = STATE(26),
[sym_gfx_section] = STATE(26),
[sym_gff_section] = STATE(26),
[sym_label_section] = STATE(26),
[sym_map_section] = STATE(26),
[sym_sfx_section] = STATE(26),
[sym_music_section] = STATE(26),
[sym_unknown_section] = STATE(26),
[aux_sym_cartridge_repeat2] = STATE(10),
[ts_builtin_sym_end] = ACTIONS(27),
[sym_lua_marker] = ACTIONS(11),
[sym_gfx_marker] = ACTIONS(13),
[sym_gff_marker] = ACTIONS(15),
[sym_label_marker] = ACTIONS(17),
[sym_map_marker] = ACTIONS(19),
[sym_sfx_marker] = ACTIONS(21),
[sym_music_marker] = ACTIONS(23),
[sym_section_marker] = ACTIONS(25),
},
[9] = {
[sym_section] = STATE(10),
[sym_lua_section] = STATE(26),
[sym_gfx_section] = STATE(26),
[sym_gff_section] = STATE(26),
[sym_label_section] = STATE(26),
[sym_map_section] = STATE(26),
[sym_sfx_section] = STATE(26),
[sym_music_section] = STATE(26),
[sym_unknown_section] = STATE(26),
[aux_sym_cartridge_repeat2] = STATE(10),
[ts_builtin_sym_end] = ACTIONS(39),
[sym_lua_marker] = ACTIONS(11),
[sym_gfx_marker] = ACTIONS(13),
[sym_gff_marker] = ACTIONS(15),
[sym_label_marker] = ACTIONS(17),
[sym_map_marker] = ACTIONS(19),
[sym_sfx_marker] = ACTIONS(21),
[sym_music_marker] = ACTIONS(23),
[sym_section_marker] = ACTIONS(25),
},
[10] = {
[sym_section] = STATE(10),
[sym_lua_section] = STATE(26),
[sym_gfx_section] = STATE(26),
[sym_gff_section] = STATE(26),
[sym_label_section] = STATE(26),
[sym_map_section] = STATE(26),
[sym_sfx_section] = STATE(26),
[sym_music_section] = STATE(26),
[sym_unknown_section] = STATE(26),
[aux_sym_cartridge_repeat2] = STATE(10),
[ts_builtin_sym_end] = ACTIONS(41),
[sym_lua_marker] = ACTIONS(43),
[sym_gfx_marker] = ACTIONS(46),
[sym_gff_marker] = ACTIONS(49),
[sym_label_marker] = ACTIONS(52),
[sym_map_marker] = ACTIONS(55),
[sym_sfx_marker] = ACTIONS(58),
[sym_music_marker] = ACTIONS(61),
[sym_section_marker] = ACTIONS(64),
},
[11] = {
[sym_section] = STATE(12),
[sym_lua_section] = STATE(26),
[sym_gfx_section] = STATE(26),
[sym_gff_section] = STATE(26),
[sym_label_section] = STATE(26),
[sym_map_section] = STATE(26),
[sym_sfx_section] = STATE(26),
[sym_music_section] = STATE(26),
[sym_unknown_section] = STATE(26),
[aux_sym_cartridge_repeat2] = STATE(12),
[ts_builtin_sym_end] = ACTIONS(39),
[sym_lua_marker] = ACTIONS(11),
[sym_gfx_marker] = ACTIONS(13),
[sym_gff_marker] = ACTIONS(15),
[sym_label_marker] = ACTIONS(17),
[sym_map_marker] = ACTIONS(19),
[sym_sfx_marker] = ACTIONS(21),
[sym_music_marker] = ACTIONS(23),
[sym_section_marker] = ACTIONS(25),
},
[12] = {
[sym_section] = STATE(10),
[sym_lua_section] = STATE(26),
[sym_gfx_section] = STATE(26),
[sym_gff_section] = STATE(26),
[sym_label_section] = STATE(26),
[sym_map_section] = STATE(26),
[sym_sfx_section] = STATE(26),
[sym_music_section] = STATE(26),
[sym_unknown_section] = STATE(26),
[aux_sym_cartridge_repeat2] = STATE(10),
[ts_builtin_sym_end] = ACTIONS(67),
[sym_lua_marker] = ACTIONS(11),
[sym_gfx_marker] = ACTIONS(13),
[sym_gff_marker] = ACTIONS(15),
[sym_label_marker] = ACTIONS(17),
[sym_map_marker] = ACTIONS(19),
[sym_sfx_marker] = ACTIONS(21),
[sym_music_marker] = ACTIONS(23),
[sym_section_marker] = ACTIONS(25),
},
};
static const uint16_t ts_small_parse_table[] = {
[0] = 5,
ACTIONS(71), 1,
sym_section_marker,
STATE(33), 1,
sym_body,
ACTIONS(73), 2,
aux_sym_line_token1,
aux_sym_line_token2,
STATE(23), 2,
sym_line,
aux_sym_lua_content_repeat1,
ACTIONS(69), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[25] = 5,
ACTIONS(77), 1,
sym_section_marker,
STATE(32), 1,
sym_body,
ACTIONS(73), 2,
aux_sym_line_token1,
aux_sym_line_token2,
STATE(23), 2,
sym_line,
aux_sym_lua_content_repeat1,
ACTIONS(75), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[50] = 5,
ACTIONS(81), 1,
sym_section_marker,
STATE(31), 1,
sym_body,
ACTIONS(73), 2,
aux_sym_line_token1,
aux_sym_line_token2,
STATE(23), 2,
sym_line,
aux_sym_lua_content_repeat1,
ACTIONS(79), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[75] = 5,
ACTIONS(85), 1,
sym_section_marker,
STATE(28), 1,
sym_body,
ACTIONS(73), 2,
aux_sym_line_token1,
aux_sym_line_token2,
STATE(23), 2,
sym_line,
aux_sym_lua_content_repeat1,
ACTIONS(83), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[100] = 5,
ACTIONS(89), 1,
sym_section_marker,
STATE(29), 1,
sym_body,
ACTIONS(73), 2,
aux_sym_line_token1,
aux_sym_line_token2,
STATE(23), 2,
sym_line,
aux_sym_lua_content_repeat1,
ACTIONS(87), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[125] = 5,
ACTIONS(93), 1,
sym_section_marker,
STATE(27), 1,
sym_lua_content,
ACTIONS(73), 2,
aux_sym_line_token1,
aux_sym_line_token2,
STATE(21), 2,
sym_line,
aux_sym_lua_content_repeat1,
ACTIONS(91), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[150] = 5,
ACTIONS(97), 1,
sym_section_marker,
STATE(30), 1,
sym_body,
ACTIONS(73), 2,
aux_sym_line_token1,
aux_sym_line_token2,
STATE(23), 2,
sym_line,
aux_sym_lua_content_repeat1,
ACTIONS(95), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[175] = 5,
ACTIONS(101), 1,
sym_section_marker,
STATE(34), 1,
sym_body,
ACTIONS(73), 2,
aux_sym_line_token1,
aux_sym_line_token2,
STATE(23), 2,
sym_line,
aux_sym_lua_content_repeat1,
ACTIONS(99), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[200] = 4,
ACTIONS(105), 1,
sym_section_marker,
ACTIONS(73), 2,
aux_sym_line_token1,
aux_sym_line_token2,
STATE(24), 2,
sym_line,
aux_sym_lua_content_repeat1,
ACTIONS(103), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[222] = 4,
ACTIONS(109), 1,
sym__blank_line,
ACTIONS(112), 1,
sym_section_marker,
STATE(22), 1,
aux_sym_cartridge_repeat1,
ACTIONS(107), 10,
ts_builtin_sym_end,
sym_header,
sym_version,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[244] = 4,
ACTIONS(116), 1,
sym_section_marker,
ACTIONS(73), 2,
aux_sym_line_token1,
aux_sym_line_token2,
STATE(24), 2,
sym_line,
aux_sym_lua_content_repeat1,
ACTIONS(114), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[266] = 4,
ACTIONS(120), 1,
sym_section_marker,
ACTIONS(122), 2,
aux_sym_line_token1,
aux_sym_line_token2,
STATE(24), 2,
sym_line,
aux_sym_lua_content_repeat1,
ACTIONS(118), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[288] = 2,
ACTIONS(127), 3,
sym_section_marker,
aux_sym_line_token1,
aux_sym_line_token2,
ACTIONS(125), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[304] = 2,
ACTIONS(131), 1,
sym_section_marker,
ACTIONS(129), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[318] = 2,
ACTIONS(135), 1,
sym_section_marker,
ACTIONS(133), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[332] = 2,
ACTIONS(139), 1,
sym_section_marker,
ACTIONS(137), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[346] = 2,
ACTIONS(143), 1,
sym_section_marker,
ACTIONS(141), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[360] = 2,
ACTIONS(147), 1,
sym_section_marker,
ACTIONS(145), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[374] = 2,
ACTIONS(151), 1,
sym_section_marker,
ACTIONS(149), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[388] = 2,
ACTIONS(155), 1,
sym_section_marker,
ACTIONS(153), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[402] = 2,
ACTIONS(159), 1,
sym_section_marker,
ACTIONS(157), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[416] = 2,
ACTIONS(163), 1,
sym_section_marker,
ACTIONS(161), 8,
ts_builtin_sym_end,
sym_lua_marker,
sym_gfx_marker,
sym_gff_marker,
sym_label_marker,
sym_map_marker,
sym_sfx_marker,
sym_music_marker,
[430] = 1,
ACTIONS(165), 1,
ts_builtin_sym_end,
};
static const uint32_t ts_small_parse_table_map[] = {
[SMALL_STATE(13)] = 0,
[SMALL_STATE(14)] = 25,
[SMALL_STATE(15)] = 50,
[SMALL_STATE(16)] = 75,
[SMALL_STATE(17)] = 100,
[SMALL_STATE(18)] = 125,
[SMALL_STATE(19)] = 150,
[SMALL_STATE(20)] = 175,
[SMALL_STATE(21)] = 200,
[SMALL_STATE(22)] = 222,
[SMALL_STATE(23)] = 244,
[SMALL_STATE(24)] = 266,
[SMALL_STATE(25)] = 288,
[SMALL_STATE(26)] = 304,
[SMALL_STATE(27)] = 318,
[SMALL_STATE(28)] = 332,
[SMALL_STATE(29)] = 346,
[SMALL_STATE(30)] = 360,
[SMALL_STATE(31)] = 374,
[SMALL_STATE(32)] = 388,
[SMALL_STATE(33)] = 402,
[SMALL_STATE(34)] = 416,
[SMALL_STATE(35)] = 430,
};
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}}, REDUCE(sym_cartridge, 0, 0, 0),
[5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2),
[7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3),
[9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7),
[11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18),
[13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20),
[15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15),
[17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16),
[19] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17),
[21] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13),
[23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14),
[25] = {.entry = {.count = 1, .reusable = false}}, SHIFT(19),
[27] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_cartridge, 1, 0, 0),
[29] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22),
[31] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4),
[33] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5),
[35] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_cartridge, 2, 0, 0),
[37] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11),
[39] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_cartridge, 3, 0, 0),
[41] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_cartridge_repeat2, 2, 0, 0),
[43] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_cartridge_repeat2, 2, 0, 0), SHIFT_REPEAT(18),
[46] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_cartridge_repeat2, 2, 0, 0), SHIFT_REPEAT(20),
[49] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_cartridge_repeat2, 2, 0, 0), SHIFT_REPEAT(15),
[52] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_cartridge_repeat2, 2, 0, 0), SHIFT_REPEAT(16),
[55] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_cartridge_repeat2, 2, 0, 0), SHIFT_REPEAT(17),
[58] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_cartridge_repeat2, 2, 0, 0), SHIFT_REPEAT(13),
[61] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_cartridge_repeat2, 2, 0, 0), SHIFT_REPEAT(14),
[64] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_cartridge_repeat2, 2, 0, 0), SHIFT_REPEAT(19),
[67] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_cartridge, 4, 0, 0),
[69] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sfx_section, 1, 0, 0),
[71] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sfx_section, 1, 0, 0),
[73] = {.entry = {.count = 1, .reusable = false}}, SHIFT(25),
[75] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_music_section, 1, 0, 0),
[77] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_music_section, 1, 0, 0),
[79] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_gff_section, 1, 0, 0),
[81] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_gff_section, 1, 0, 0),
[83] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_label_section, 1, 0, 0),
[85] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_label_section, 1, 0, 0),
[87] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_map_section, 1, 0, 0),
[89] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_map_section, 1, 0, 0),
[91] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_lua_section, 1, 0, 0),
[93] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_lua_section, 1, 0, 0),
[95] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_unknown_section, 1, 0, 0),
[97] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_unknown_section, 1, 0, 0),
[99] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_gfx_section, 1, 0, 0),
[101] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_gfx_section, 1, 0, 0),
[103] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_lua_content, 1, 0, 0),
[105] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_lua_content, 1, 0, 0),
[107] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_cartridge_repeat1, 2, 0, 0),
[109] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_cartridge_repeat1, 2, 0, 0), SHIFT_REPEAT(22),
[112] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_cartridge_repeat1, 2, 0, 0),
[114] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_body, 1, 0, 0),
[116] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_body, 1, 0, 0),
[118] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_lua_content_repeat1, 2, 0, 0),
[120] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_lua_content_repeat1, 2, 0, 0),
[122] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_lua_content_repeat1, 2, 0, 0), SHIFT_REPEAT(25),
[125] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_line, 1, 0, 0),
[127] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_line, 1, 0, 0),
[129] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_section, 1, 0, 0),
[131] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_section, 1, 0, 0),
[133] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_lua_section, 2, 0, 0),
[135] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_lua_section, 2, 0, 0),
[137] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_label_section, 2, 0, 0),
[139] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_label_section, 2, 0, 0),
[141] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_map_section, 2, 0, 0),
[143] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_map_section, 2, 0, 0),
[145] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_unknown_section, 2, 0, 0),
[147] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_unknown_section, 2, 0, 0),
[149] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_gff_section, 2, 0, 0),
[151] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_gff_section, 2, 0, 0),
[153] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_music_section, 2, 0, 0),
[155] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_music_section, 2, 0, 0),
[157] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sfx_section, 2, 0, 0),
[159] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sfx_section, 2, 0, 0),
[161] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_gfx_section, 2, 0, 0),
[163] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_gfx_section, 2, 0, 0),
[165] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(),
};
#ifdef __cplusplus
extern "C" {
#endif
#ifdef TREE_SITTER_HIDE_SYMBOLS
#define TS_PUBLIC
#elif defined(_WIN32)
#define TS_PUBLIC __declspec(dllexport)
#else
#define TS_PUBLIC __attribute__((visibility("default")))
#endif
TS_PUBLIC const TSLanguage *tree_sitter_p8_cart(void) {
static const TSLanguage language = {
.version = LANGUAGE_VERSION,
.symbol_count = SYMBOL_COUNT,
.alias_count = ALIAS_COUNT,
.token_count = TOKEN_COUNT,
.external_token_count = EXTERNAL_TOKEN_COUNT,
.state_count = STATE_COUNT,
.large_state_count = LARGE_STATE_COUNT,
.production_id_count = PRODUCTION_ID_COUNT,
.field_count = FIELD_COUNT,
.max_alias_sequence_length = MAX_ALIAS_SEQUENCE_LENGTH,
.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 = &ts_alias_sequences[0][0],
.lex_modes = ts_lex_modes,
.lex_fn = ts_lex,
.primary_state_ids = ts_primary_state_ids,
};
return &language;
}
#ifdef __cplusplus
}
#endif