diff --git a/grammar.js b/grammar.js index 07be47c..386aec5 100644 --- a/grammar.js +++ b/grammar.js @@ -18,7 +18,7 @@ module.exports = grammar({ rules: { - program : $ => repeat($.definition), + program : $ => repeat(choice($.definition, $.preprocess)), identifier : $ => /[a-zA-Z_]\w*/, @@ -103,5 +103,11 @@ module.exports = grammar({ ';', ), + preprocess : $ => seq($.command, $.post_command), + + post_command : $ => /.+/, + + command : $ => '@include', + } }); diff --git a/src/grammar.json b/src/grammar.json index 9c8c4ca..ea2bef3 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -4,8 +4,17 @@ "program": { "type": "REPEAT", "content": { - "type": "SYMBOL", - "name": "definition" + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "definition" + }, + { + "type": "SYMBOL", + "name": "preprocess" + } + ] } }, "identifier": { @@ -374,6 +383,27 @@ "value": ";" } ] + }, + "preprocess": { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "command" + }, + { + "type": "SYMBOL", + "name": "post_command" + } + ] + }, + "post_command": { + "type": "PATTERN", + "value": ".+" + }, + "command": { + "type": "STRING", + "value": "@include" } }, "extras": [ diff --git a/src/node-types.json b/src/node-types.json index ff15e43..667aa6e 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -193,6 +193,25 @@ } } }, + { + "type": "preprocess", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "command", + "named": true + }, + { + "type": "post_command", + "named": true + } + ] + } + }, { "type": "program", "named": true, @@ -204,6 +223,10 @@ { "type": "definition", "named": true + }, + { + "type": "preprocess", + "named": true } ] } @@ -284,6 +307,10 @@ "type": "block_comment", "named": true }, + { + "type": "command", + "named": true + }, { "type": "comment", "named": true @@ -300,6 +327,10 @@ "type": "identifier", "named": true }, + { + "type": "post_command", + "named": true + }, { "type": "star", "named": true diff --git a/src/parser.c b/src/parser.c index 48535cd..7d64438 100644 --- a/src/parser.c +++ b/src/parser.c @@ -5,11 +5,11 @@ #endif #define LANGUAGE_VERSION 14 -#define STATE_COUNT 50 -#define LARGE_STATE_COUNT 12 -#define SYMBOL_COUNT 38 +#define STATE_COUNT 52 +#define LARGE_STATE_COUNT 5 +#define SYMBOL_COUNT 41 #define ALIAS_COUNT 0 -#define TOKEN_COUNT 22 +#define TOKEN_COUNT 24 #define EXTERNAL_TOKEN_COUNT 0 #define FIELD_COUNT 3 #define MAX_ALIAS_SEQUENCE_LENGTH 6 @@ -37,22 +37,25 @@ enum ts_symbol_identifiers { anon_sym_u2192 = 19, anon_sym_COLON_EQ = 20, anon_sym_SEMI = 21, - sym_program = 22, - sym_param_block = 23, - sym_square = 24, - sym_labs = 25, - sym_pabs = 26, - sym_term = 27, - sym_app = 28, - sym_arrow = 29, - sym_app_term = 30, - sym_expr = 31, - sym_ascription = 32, - sym_definition = 33, - aux_sym_program_repeat1 = 34, - aux_sym_param_block_repeat1 = 35, - aux_sym_labs_repeat1 = 36, - aux_sym_app_repeat1 = 37, + sym_post_command = 22, + sym_command = 23, + sym_program = 24, + sym_param_block = 25, + sym_square = 26, + sym_labs = 27, + sym_pabs = 28, + sym_term = 29, + sym_app = 30, + sym_arrow = 31, + sym_app_term = 32, + sym_expr = 33, + sym_ascription = 34, + sym_definition = 35, + sym_preprocess = 36, + aux_sym_program_repeat1 = 37, + aux_sym_param_block_repeat1 = 38, + aux_sym_labs_repeat1 = 39, + aux_sym_app_repeat1 = 40, }; static const char * const ts_symbol_names[] = { @@ -78,6 +81,8 @@ static const char * const ts_symbol_names[] = { [anon_sym_u2192] = "\u2192", [anon_sym_COLON_EQ] = ":=", [anon_sym_SEMI] = ";", + [sym_post_command] = "post_command", + [sym_command] = "command", [sym_program] = "program", [sym_param_block] = "param_block", [sym_square] = "square", @@ -90,6 +95,7 @@ static const char * const ts_symbol_names[] = { [sym_expr] = "expr", [sym_ascription] = "ascription", [sym_definition] = "definition", + [sym_preprocess] = "preprocess", [aux_sym_program_repeat1] = "program_repeat1", [aux_sym_param_block_repeat1] = "param_block_repeat1", [aux_sym_labs_repeat1] = "labs_repeat1", @@ -119,6 +125,8 @@ static const TSSymbol ts_symbol_map[] = { [anon_sym_u2192] = anon_sym_u2192, [anon_sym_COLON_EQ] = anon_sym_COLON_EQ, [anon_sym_SEMI] = anon_sym_SEMI, + [sym_post_command] = sym_post_command, + [sym_command] = sym_command, [sym_program] = sym_program, [sym_param_block] = sym_param_block, [sym_square] = sym_square, @@ -131,6 +139,7 @@ static const TSSymbol ts_symbol_map[] = { [sym_expr] = sym_expr, [sym_ascription] = sym_ascription, [sym_definition] = sym_definition, + [sym_preprocess] = sym_preprocess, [aux_sym_program_repeat1] = aux_sym_program_repeat1, [aux_sym_param_block_repeat1] = aux_sym_param_block_repeat1, [aux_sym_labs_repeat1] = aux_sym_labs_repeat1, @@ -226,6 +235,14 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = false, }, + [sym_post_command] = { + .visible = true, + .named = true, + }, + [sym_command] = { + .visible = true, + .named = true, + }, [sym_program] = { .visible = true, .named = true, @@ -274,6 +291,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, + [sym_preprocess] = { + .visible = true, + .named = true, + }, [aux_sym_program_repeat1] = { .visible = false, .named = false, @@ -383,6 +404,8 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [47] = 47, [48] = 48, [49] = 49, + [50] = 50, + [51] = 51, }; static bool ts_lex(TSLexer *lexer, TSStateId state) { @@ -390,264 +413,352 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { eof = lexer->eof(lexer); switch (state) { case 0: - if (eof) ADVANCE(10); + if (eof) ADVANCE(18); ADVANCE_MAP( - '(', 24, - ')', 26, - '*', 27, - ',', 36, - '-', 5, - ':', 25, - ';', 41, - '=', 6, - '[', 2, - 'a', 20, - 'f', 17, - 0x3bb, 30, - 0x2192, 39, - 0x21d2, 33, - 0x220f, 34, - 0x25a1, 28, + '(', 33, + ')', 35, + '*', 36, + ',', 45, + '-', 6, + ':', 34, + ';', 50, + '=', 7, + '@', 12, + '[', 3, + 'a', 28, + 'f', 25, + 0x3bb, 39, + 0x2192, 48, + 0x21d2, 42, + 0x220f, 43, + 0x25a1, 37, ); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(0); if (('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('b' <= lookahead && lookahead <= 'z')) ADVANCE(21); + ('b' <= lookahead && lookahead <= 'z')) ADVANCE(29); END_STATE(); case 1: - ADVANCE_MAP( - '(', 24, - '*', 27, - '-', 4, - '[', 2, - 'f', 17, - 0x3bb, 30, - 0x220f, 34, - 0x25a1, 28, - ); + if (lookahead == '\n') SKIP(1); + if (lookahead == '-') ADVANCE(55); + if (lookahead == '[') ADVANCE(54); if (('\t' <= lookahead && lookahead <= '\r') || - lookahead == ' ') SKIP(1); - if (('A' <= lookahead && lookahead <= 'Z') || - lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(21); + lookahead == ' ') ADVANCE(56); + if (lookahead != 0) ADVANCE(57); END_STATE(); case 2: - if (lookahead == '*') ADVANCE(3); - if (lookahead == ']') ADVANCE(29); - END_STATE(); - case 3: - if (lookahead == '*') ADVANCE(7); - if (lookahead == '[') ADVANCE(8); - if (lookahead != 0 && - lookahead != ']') ADVANCE(3); - END_STATE(); - case 4: - if (lookahead == '-') ADVANCE(22); - END_STATE(); - case 5: - if (lookahead == '-') ADVANCE(22); - if (lookahead == '>') ADVANCE(38); - END_STATE(); - case 6: - if (lookahead == '>') ADVANCE(32); - END_STATE(); - case 7: - if (lookahead == ']') ADVANCE(23); - if (lookahead != 0) ADVANCE(3); - END_STATE(); - case 8: - if (lookahead != 0) ADVANCE(3); - END_STATE(); - case 9: - if (eof) ADVANCE(10); ADVANCE_MAP( - '(', 24, - ')', 26, - '*', 27, + '(', 33, + '*', 36, '-', 5, - ':', 25, - ';', 41, - '[', 2, - 0x2192, 39, - 0x25a1, 28, + '[', 3, + 'f', 25, + 0x3bb, 39, + 0x220f, 43, + 0x25a1, 37, ); if (('\t' <= lookahead && lookahead <= '\r') || - lookahead == ' ') SKIP(9); + lookahead == ' ') SKIP(2); if (('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(21); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(29); + END_STATE(); + case 3: + if (lookahead == '*') ADVANCE(4); + if (lookahead == ']') ADVANCE(38); + END_STATE(); + case 4: + if (lookahead == '*') ADVANCE(8); + if (lookahead == '[') ADVANCE(16); + if (lookahead != 0 && + lookahead != ']') ADVANCE(4); + END_STATE(); + case 5: + if (lookahead == '-') ADVANCE(30); + END_STATE(); + case 6: + if (lookahead == '-') ADVANCE(30); + if (lookahead == '>') ADVANCE(47); + END_STATE(); + case 7: + if (lookahead == '>') ADVANCE(41); + END_STATE(); + case 8: + if (lookahead == ']') ADVANCE(32); + if (lookahead != 0) ADVANCE(4); + END_STATE(); + case 9: + if (lookahead == 'c') ADVANCE(13); END_STATE(); case 10: - ACCEPT_TOKEN(ts_builtin_sym_end); + if (lookahead == 'd') ADVANCE(11); END_STATE(); case 11: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == 'a') ADVANCE(14); - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'Z') || - lookahead == '_' || - ('b' <= lookahead && lookahead <= 'z')) ADVANCE(21); + if (lookahead == 'e') ADVANCE(58); END_STATE(); case 12: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == 'i') ADVANCE(18); - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'Z') || - lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(21); + if (lookahead == 'i') ADVANCE(14); END_STATE(); case 13: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == 'l') ADVANCE(35); - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'Z') || - lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(21); + if (lookahead == 'l') ADVANCE(15); END_STATE(); case 14: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == 'l') ADVANCE(13); - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'Z') || - lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(21); + if (lookahead == 'n') ADVANCE(9); END_STATE(); case 15: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == 'm') ADVANCE(37); - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'Z') || - lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(21); + if (lookahead == 'u') ADVANCE(10); END_STATE(); case 16: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == 'n') ADVANCE(31); - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'Z') || - lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(21); + if (lookahead != 0) ADVANCE(4); END_STATE(); case 17: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == 'o') ADVANCE(19); - if (lookahead == 'u') ADVANCE(16); - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'Z') || + if (eof) ADVANCE(18); + ADVANCE_MAP( + '(', 33, + ')', 35, + '*', 36, + '-', 6, + ':', 34, + ';', 50, + '@', 12, + '[', 3, + 0x2192, 48, + 0x25a1, 37, + ); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ') SKIP(17); + if (('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(21); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(29); END_STATE(); case 18: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == 'o') ADVANCE(15); - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'Z') || - lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(21); + ACCEPT_TOKEN(ts_builtin_sym_end); END_STATE(); case 19: ACCEPT_TOKEN(sym_identifier); - if (lookahead == 'r') ADVANCE(11); + if (lookahead == 'a') ADVANCE(22); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(21); + ('b' <= lookahead && lookahead <= 'z')) ADVANCE(29); END_STATE(); case 20: ACCEPT_TOKEN(sym_identifier); - if (lookahead == 'x') ADVANCE(12); + if (lookahead == 'i') ADVANCE(26); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(21); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(29); END_STATE(); case 21: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == 'l') ADVANCE(44); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(29); + END_STATE(); + case 22: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == 'l') ADVANCE(21); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(29); + END_STATE(); + case 23: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == 'm') ADVANCE(46); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(29); + END_STATE(); + case 24: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == 'n') ADVANCE(40); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(29); + END_STATE(); + case 25: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == 'o') ADVANCE(27); + if (lookahead == 'u') ADVANCE(24); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(29); + END_STATE(); + case 26: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == 'o') ADVANCE(23); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(29); + END_STATE(); + case 27: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == 'r') ADVANCE(19); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(29); + END_STATE(); + case 28: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == 'x') ADVANCE(20); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(29); + END_STATE(); + case 29: ACCEPT_TOKEN(sym_identifier); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(21); - END_STATE(); - case 22: - ACCEPT_TOKEN(sym_comment); - if (lookahead != 0 && - lookahead != '\n') ADVANCE(22); - END_STATE(); - case 23: - ACCEPT_TOKEN(sym_block_comment); - if (lookahead == '*') ADVANCE(7); - if (lookahead == '[') ADVANCE(8); - if (lookahead != 0 && - lookahead != ']') ADVANCE(3); - END_STATE(); - case 24: - ACCEPT_TOKEN(anon_sym_LPAREN); - END_STATE(); - case 25: - ACCEPT_TOKEN(anon_sym_COLON); - if (lookahead == '=') ADVANCE(40); - END_STATE(); - case 26: - ACCEPT_TOKEN(anon_sym_RPAREN); - END_STATE(); - case 27: - ACCEPT_TOKEN(sym_star); - END_STATE(); - case 28: - ACCEPT_TOKEN(anon_sym_u25a1); - END_STATE(); - case 29: - ACCEPT_TOKEN(anon_sym_LBRACK_RBRACK); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(29); END_STATE(); case 30: - ACCEPT_TOKEN(anon_sym_u03bb); + ACCEPT_TOKEN(sym_comment); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(30); END_STATE(); case 31: + ACCEPT_TOKEN(sym_block_comment); + if (lookahead == '\n') ADVANCE(4); + if (lookahead == '*') ADVANCE(52); + if (lookahead == '[') ADVANCE(53); + if (lookahead == ']') ADVANCE(57); + if (lookahead != 0) ADVANCE(51); + END_STATE(); + case 32: + ACCEPT_TOKEN(sym_block_comment); + if (lookahead == '*') ADVANCE(8); + if (lookahead == '[') ADVANCE(16); + if (lookahead != 0 && + lookahead != ']') ADVANCE(4); + END_STATE(); + case 33: + ACCEPT_TOKEN(anon_sym_LPAREN); + END_STATE(); + case 34: + ACCEPT_TOKEN(anon_sym_COLON); + if (lookahead == '=') ADVANCE(49); + END_STATE(); + case 35: + ACCEPT_TOKEN(anon_sym_RPAREN); + END_STATE(); + case 36: + ACCEPT_TOKEN(sym_star); + END_STATE(); + case 37: + ACCEPT_TOKEN(anon_sym_u25a1); + END_STATE(); + case 38: + ACCEPT_TOKEN(anon_sym_LBRACK_RBRACK); + END_STATE(); + case 39: + ACCEPT_TOKEN(anon_sym_u03bb); + END_STATE(); + case 40: ACCEPT_TOKEN(anon_sym_fun); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(21); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(29); END_STATE(); - case 32: + case 41: ACCEPT_TOKEN(anon_sym_EQ_GT); END_STATE(); - case 33: + case 42: ACCEPT_TOKEN(anon_sym_u21d2); END_STATE(); - case 34: + case 43: ACCEPT_TOKEN(anon_sym_u220f); END_STATE(); - case 35: + case 44: ACCEPT_TOKEN(anon_sym_forall); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(21); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(29); END_STATE(); - case 36: + case 45: ACCEPT_TOKEN(anon_sym_COMMA); END_STATE(); - case 37: + case 46: ACCEPT_TOKEN(sym_axiom); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(21); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(29); END_STATE(); - case 38: + case 47: ACCEPT_TOKEN(anon_sym_DASH_GT); END_STATE(); - case 39: + case 48: ACCEPT_TOKEN(anon_sym_u2192); END_STATE(); - case 40: + case 49: ACCEPT_TOKEN(anon_sym_COLON_EQ); END_STATE(); - case 41: + case 50: ACCEPT_TOKEN(anon_sym_SEMI); END_STATE(); + case 51: + ACCEPT_TOKEN(sym_post_command); + if (lookahead == '\n') ADVANCE(4); + if (lookahead == '*') ADVANCE(52); + if (lookahead == '[') ADVANCE(53); + if (lookahead == ']') ADVANCE(57); + if (lookahead != 0) ADVANCE(51); + END_STATE(); + case 52: + ACCEPT_TOKEN(sym_post_command); + if (lookahead == '\n') ADVANCE(4); + if (lookahead == ']') ADVANCE(31); + if (lookahead != 0) ADVANCE(51); + END_STATE(); + case 53: + ACCEPT_TOKEN(sym_post_command); + if (lookahead == '\n') ADVANCE(4); + if (lookahead != 0) ADVANCE(51); + END_STATE(); + case 54: + ACCEPT_TOKEN(sym_post_command); + if (lookahead == '*') ADVANCE(51); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(57); + END_STATE(); + case 55: + ACCEPT_TOKEN(sym_post_command); + if (lookahead == '-') ADVANCE(30); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(57); + END_STATE(); + case 56: + ACCEPT_TOKEN(sym_post_command); + if (lookahead == '-') ADVANCE(55); + if (lookahead == '[') ADVANCE(54); + if (lookahead == '\t' || + (0x0b <= lookahead && lookahead <= '\r') || + lookahead == ' ') ADVANCE(56); + if (lookahead != 0 && + (lookahead < '\t' || '\r' < lookahead)) ADVANCE(57); + END_STATE(); + case 57: + ACCEPT_TOKEN(sym_post_command); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(57); + END_STATE(); + case 58: + ACCEPT_TOKEN(sym_command); + END_STATE(); default: return false; } @@ -655,28 +766,28 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { static const TSLexMode ts_lex_modes[STATE_COUNT] = { [0] = {.lex_state = 0}, - [1] = {.lex_state = 9}, + [1] = {.lex_state = 17}, [2] = {.lex_state = 0}, [3] = {.lex_state = 0}, [4] = {.lex_state = 0}, - [5] = {.lex_state = 1}, - [6] = {.lex_state = 1}, - [7] = {.lex_state = 1}, - [8] = {.lex_state = 1}, - [9] = {.lex_state = 1}, - [10] = {.lex_state = 1}, - [11] = {.lex_state = 1}, - [12] = {.lex_state = 9}, - [13] = {.lex_state = 9}, - [14] = {.lex_state = 9}, - [15] = {.lex_state = 9}, - [16] = {.lex_state = 9}, + [5] = {.lex_state = 2}, + [6] = {.lex_state = 2}, + [7] = {.lex_state = 2}, + [8] = {.lex_state = 2}, + [9] = {.lex_state = 2}, + [10] = {.lex_state = 2}, + [11] = {.lex_state = 2}, + [12] = {.lex_state = 17}, + [13] = {.lex_state = 17}, + [14] = {.lex_state = 17}, + [15] = {.lex_state = 17}, + [16] = {.lex_state = 17}, [17] = {.lex_state = 0}, - [18] = {.lex_state = 0}, + [18] = {.lex_state = 17}, [19] = {.lex_state = 0}, [20] = {.lex_state = 0}, [21] = {.lex_state = 0}, - [22] = {.lex_state = 0}, + [22] = {.lex_state = 17}, [23] = {.lex_state = 0}, [24] = {.lex_state = 0}, [25] = {.lex_state = 0}, @@ -684,26 +795,28 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [27] = {.lex_state = 0}, [28] = {.lex_state = 0}, [29] = {.lex_state = 0}, - [30] = {.lex_state = 9}, - [31] = {.lex_state = 9}, - [32] = {.lex_state = 9}, - [33] = {.lex_state = 9}, - [34] = {.lex_state = 9}, + [30] = {.lex_state = 0}, + [31] = {.lex_state = 0}, + [32] = {.lex_state = 17}, + [33] = {.lex_state = 0}, + [34] = {.lex_state = 17}, [35] = {.lex_state = 0}, - [36] = {.lex_state = 0}, - [37] = {.lex_state = 9}, - [38] = {.lex_state = 9}, - [39] = {.lex_state = 9}, - [40] = {.lex_state = 0}, + [36] = {.lex_state = 17}, + [37] = {.lex_state = 17}, + [38] = {.lex_state = 17}, + [39] = {.lex_state = 17}, + [40] = {.lex_state = 17}, [41] = {.lex_state = 0}, [42] = {.lex_state = 0}, [43] = {.lex_state = 0}, [44] = {.lex_state = 0}, [45] = {.lex_state = 0}, - [46] = {.lex_state = 0}, + [46] = {.lex_state = 1}, [47] = {.lex_state = 0}, [48] = {.lex_state = 0}, [49] = {.lex_state = 0}, + [50] = {.lex_state = 0}, + [51] = {.lex_state = 0}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { @@ -730,304 +843,390 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_u2192] = ACTIONS(1), [anon_sym_COLON_EQ] = ACTIONS(1), [anon_sym_SEMI] = ACTIONS(1), + [sym_command] = ACTIONS(1), }, [1] = { - [sym_program] = STATE(42), - [sym_definition] = STATE(31), - [aux_sym_program_repeat1] = STATE(31), + [sym_program] = STATE(45), + [sym_definition] = STATE(18), + [sym_preprocess] = STATE(18), + [aux_sym_program_repeat1] = STATE(18), [ts_builtin_sym_end] = ACTIONS(5), [sym_identifier] = ACTIONS(7), [sym_comment] = ACTIONS(3), [sym_block_comment] = ACTIONS(3), + [sym_command] = ACTIONS(9), }, [2] = { - [sym_square] = STATE(15), - [sym_labs] = STATE(23), - [sym_pabs] = STATE(23), + [sym_square] = STATE(14), + [sym_labs] = STATE(26), + [sym_pabs] = STATE(26), [sym_term] = STATE(12), - [sym_app] = STATE(23), - [sym_arrow] = STATE(24), - [sym_app_term] = STATE(22), - [sym_expr] = STATE(44), - [aux_sym_app_repeat1] = STATE(12), - [sym_identifier] = ACTIONS(9), - [sym_comment] = ACTIONS(3), - [sym_block_comment] = ACTIONS(3), - [anon_sym_LPAREN] = ACTIONS(11), - [sym_star] = ACTIONS(13), - [anon_sym_u25a1] = ACTIONS(15), - [anon_sym_LBRACK_RBRACK] = ACTIONS(15), - [anon_sym_u03bb] = ACTIONS(17), - [anon_sym_fun] = ACTIONS(19), - [anon_sym_u220f] = ACTIONS(21), - [anon_sym_forall] = ACTIONS(23), - [sym_axiom] = ACTIONS(25), - }, - [3] = { - [sym_square] = STATE(15), - [sym_labs] = STATE(23), - [sym_pabs] = STATE(23), - [sym_term] = STATE(12), - [sym_app] = STATE(23), - [sym_arrow] = STATE(24), - [sym_app_term] = STATE(22), - [sym_expr] = STATE(40), - [aux_sym_app_repeat1] = STATE(12), - [sym_identifier] = ACTIONS(9), - [sym_comment] = ACTIONS(3), - [sym_block_comment] = ACTIONS(3), - [anon_sym_LPAREN] = ACTIONS(11), - [sym_star] = ACTIONS(13), - [anon_sym_u25a1] = ACTIONS(15), - [anon_sym_LBRACK_RBRACK] = ACTIONS(15), - [anon_sym_u03bb] = ACTIONS(17), - [anon_sym_fun] = ACTIONS(19), - [anon_sym_u220f] = ACTIONS(21), - [anon_sym_forall] = ACTIONS(23), - [sym_axiom] = ACTIONS(27), - }, - [4] = { - [sym_square] = STATE(15), - [sym_labs] = STATE(23), - [sym_pabs] = STATE(23), - [sym_term] = STATE(12), - [sym_app] = STATE(23), - [sym_arrow] = STATE(24), - [sym_app_term] = STATE(22), - [sym_expr] = STATE(45), - [aux_sym_app_repeat1] = STATE(12), - [sym_identifier] = ACTIONS(9), - [sym_comment] = ACTIONS(3), - [sym_block_comment] = ACTIONS(3), - [anon_sym_LPAREN] = ACTIONS(11), - [sym_star] = ACTIONS(13), - [anon_sym_u25a1] = ACTIONS(15), - [anon_sym_LBRACK_RBRACK] = ACTIONS(15), - [anon_sym_u03bb] = ACTIONS(17), - [anon_sym_fun] = ACTIONS(19), - [anon_sym_u220f] = ACTIONS(21), - [anon_sym_forall] = ACTIONS(23), - [sym_axiom] = ACTIONS(29), - }, - [5] = { - [sym_square] = STATE(15), - [sym_labs] = STATE(23), - [sym_pabs] = STATE(23), - [sym_term] = STATE(12), - [sym_app] = STATE(23), - [sym_arrow] = STATE(24), - [sym_app_term] = STATE(22), + [sym_app] = STATE(26), + [sym_arrow] = STATE(25), + [sym_app_term] = STATE(24), [sym_expr] = STATE(43), [aux_sym_app_repeat1] = STATE(12), - [sym_identifier] = ACTIONS(9), + [sym_identifier] = ACTIONS(11), [sym_comment] = ACTIONS(3), [sym_block_comment] = ACTIONS(3), - [anon_sym_LPAREN] = ACTIONS(11), - [sym_star] = ACTIONS(13), - [anon_sym_u25a1] = ACTIONS(15), - [anon_sym_LBRACK_RBRACK] = ACTIONS(15), - [anon_sym_u03bb] = ACTIONS(17), - [anon_sym_fun] = ACTIONS(19), - [anon_sym_u220f] = ACTIONS(21), - [anon_sym_forall] = ACTIONS(23), + [anon_sym_LPAREN] = ACTIONS(13), + [sym_star] = ACTIONS(15), + [anon_sym_u25a1] = ACTIONS(17), + [anon_sym_LBRACK_RBRACK] = ACTIONS(17), + [anon_sym_u03bb] = ACTIONS(19), + [anon_sym_fun] = ACTIONS(21), + [anon_sym_u220f] = ACTIONS(23), + [anon_sym_forall] = ACTIONS(25), + [sym_axiom] = ACTIONS(27), }, - [6] = { - [sym_square] = STATE(15), - [sym_labs] = STATE(23), - [sym_pabs] = STATE(23), + [3] = { + [sym_square] = STATE(14), + [sym_labs] = STATE(26), + [sym_pabs] = STATE(26), [sym_term] = STATE(12), - [sym_app] = STATE(23), - [sym_arrow] = STATE(24), - [sym_app_term] = STATE(22), - [sym_expr] = STATE(26), - [aux_sym_app_repeat1] = STATE(12), - [sym_identifier] = ACTIONS(9), - [sym_comment] = ACTIONS(3), - [sym_block_comment] = ACTIONS(3), - [anon_sym_LPAREN] = ACTIONS(11), - [sym_star] = ACTIONS(13), - [anon_sym_u25a1] = ACTIONS(15), - [anon_sym_LBRACK_RBRACK] = ACTIONS(15), - [anon_sym_u03bb] = ACTIONS(17), - [anon_sym_fun] = ACTIONS(19), - [anon_sym_u220f] = ACTIONS(21), - [anon_sym_forall] = ACTIONS(23), - }, - [7] = { - [sym_square] = STATE(15), - [sym_labs] = STATE(23), - [sym_pabs] = STATE(23), - [sym_term] = STATE(12), - [sym_app] = STATE(23), - [sym_arrow] = STATE(24), - [sym_app_term] = STATE(22), - [sym_expr] = STATE(41), - [aux_sym_app_repeat1] = STATE(12), - [sym_identifier] = ACTIONS(9), - [sym_comment] = ACTIONS(3), - [sym_block_comment] = ACTIONS(3), - [anon_sym_LPAREN] = ACTIONS(11), - [sym_star] = ACTIONS(13), - [anon_sym_u25a1] = ACTIONS(15), - [anon_sym_LBRACK_RBRACK] = ACTIONS(15), - [anon_sym_u03bb] = ACTIONS(17), - [anon_sym_fun] = ACTIONS(19), - [anon_sym_u220f] = ACTIONS(21), - [anon_sym_forall] = ACTIONS(23), - }, - [8] = { - [sym_square] = STATE(15), - [sym_labs] = STATE(23), - [sym_pabs] = STATE(23), - [sym_term] = STATE(12), - [sym_app] = STATE(23), - [sym_arrow] = STATE(24), - [sym_app_term] = STATE(22), - [sym_expr] = STATE(46), - [aux_sym_app_repeat1] = STATE(12), - [sym_identifier] = ACTIONS(9), - [sym_comment] = ACTIONS(3), - [sym_block_comment] = ACTIONS(3), - [anon_sym_LPAREN] = ACTIONS(11), - [sym_star] = ACTIONS(13), - [anon_sym_u25a1] = ACTIONS(15), - [anon_sym_LBRACK_RBRACK] = ACTIONS(15), - [anon_sym_u03bb] = ACTIONS(17), - [anon_sym_fun] = ACTIONS(19), - [anon_sym_u220f] = ACTIONS(21), - [anon_sym_forall] = ACTIONS(23), - }, - [9] = { - [sym_square] = STATE(15), - [sym_labs] = STATE(23), - [sym_pabs] = STATE(23), - [sym_term] = STATE(12), - [sym_app] = STATE(23), - [sym_arrow] = STATE(24), - [sym_app_term] = STATE(22), + [sym_app] = STATE(26), + [sym_arrow] = STATE(25), + [sym_app_term] = STATE(24), [sym_expr] = STATE(48), [aux_sym_app_repeat1] = STATE(12), - [sym_identifier] = ACTIONS(9), + [sym_identifier] = ACTIONS(11), [sym_comment] = ACTIONS(3), [sym_block_comment] = ACTIONS(3), - [anon_sym_LPAREN] = ACTIONS(11), - [sym_star] = ACTIONS(13), - [anon_sym_u25a1] = ACTIONS(15), - [anon_sym_LBRACK_RBRACK] = ACTIONS(15), - [anon_sym_u03bb] = ACTIONS(17), - [anon_sym_fun] = ACTIONS(19), - [anon_sym_u220f] = ACTIONS(21), - [anon_sym_forall] = ACTIONS(23), + [anon_sym_LPAREN] = ACTIONS(13), + [sym_star] = ACTIONS(15), + [anon_sym_u25a1] = ACTIONS(17), + [anon_sym_LBRACK_RBRACK] = ACTIONS(17), + [anon_sym_u03bb] = ACTIONS(19), + [anon_sym_fun] = ACTIONS(21), + [anon_sym_u220f] = ACTIONS(23), + [anon_sym_forall] = ACTIONS(25), + [sym_axiom] = ACTIONS(29), }, - [10] = { - [sym_square] = STATE(15), - [sym_labs] = STATE(23), - [sym_pabs] = STATE(23), + [4] = { + [sym_square] = STATE(14), + [sym_labs] = STATE(26), + [sym_pabs] = STATE(26), [sym_term] = STATE(12), - [sym_app] = STATE(23), - [sym_arrow] = STATE(24), - [sym_app_term] = STATE(22), - [sym_expr] = STATE(28), + [sym_app] = STATE(26), + [sym_arrow] = STATE(25), + [sym_app_term] = STATE(24), + [sym_expr] = STATE(47), [aux_sym_app_repeat1] = STATE(12), - [sym_identifier] = ACTIONS(9), + [sym_identifier] = ACTIONS(11), [sym_comment] = ACTIONS(3), [sym_block_comment] = ACTIONS(3), - [anon_sym_LPAREN] = ACTIONS(11), - [sym_star] = ACTIONS(13), - [anon_sym_u25a1] = ACTIONS(15), - [anon_sym_LBRACK_RBRACK] = ACTIONS(15), - [anon_sym_u03bb] = ACTIONS(17), - [anon_sym_fun] = ACTIONS(19), - [anon_sym_u220f] = ACTIONS(21), - [anon_sym_forall] = ACTIONS(23), - }, - [11] = { - [sym_square] = STATE(15), - [sym_labs] = STATE(23), - [sym_pabs] = STATE(23), - [sym_term] = STATE(12), - [sym_app] = STATE(23), - [sym_arrow] = STATE(24), - [sym_app_term] = STATE(22), - [sym_expr] = STATE(27), - [aux_sym_app_repeat1] = STATE(12), - [sym_identifier] = ACTIONS(9), - [sym_comment] = ACTIONS(3), - [sym_block_comment] = ACTIONS(3), - [anon_sym_LPAREN] = ACTIONS(11), - [sym_star] = ACTIONS(13), - [anon_sym_u25a1] = ACTIONS(15), - [anon_sym_LBRACK_RBRACK] = ACTIONS(15), - [anon_sym_u03bb] = ACTIONS(17), - [anon_sym_fun] = ACTIONS(19), - [anon_sym_u220f] = ACTIONS(21), - [anon_sym_forall] = ACTIONS(23), + [anon_sym_LPAREN] = ACTIONS(13), + [sym_star] = ACTIONS(15), + [anon_sym_u25a1] = ACTIONS(17), + [anon_sym_LBRACK_RBRACK] = ACTIONS(17), + [anon_sym_u03bb] = ACTIONS(19), + [anon_sym_fun] = ACTIONS(21), + [anon_sym_u220f] = ACTIONS(23), + [anon_sym_forall] = ACTIONS(25), + [sym_axiom] = ACTIONS(31), }, }; static const uint16_t ts_small_parse_table[] = { - [0] = 7, + [0] = 15, ACTIONS(11), 1, + sym_identifier, + ACTIONS(13), 1, anon_sym_LPAREN, - STATE(15), 1, + ACTIONS(15), 1, + sym_star, + ACTIONS(19), 1, + anon_sym_u03bb, + ACTIONS(21), 1, + anon_sym_fun, + ACTIONS(23), 1, + anon_sym_u220f, + ACTIONS(25), 1, + anon_sym_forall, + STATE(14), 1, + sym_square, + STATE(24), 1, + sym_app_term, + STATE(25), 1, + sym_arrow, + STATE(49), 1, + sym_expr, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + ACTIONS(17), 2, + anon_sym_u25a1, + anon_sym_LBRACK_RBRACK, + STATE(12), 2, + sym_term, + aux_sym_app_repeat1, + STATE(26), 3, + sym_labs, + sym_pabs, + sym_app, + [51] = 15, + ACTIONS(11), 1, + sym_identifier, + ACTIONS(13), 1, + anon_sym_LPAREN, + ACTIONS(15), 1, + sym_star, + ACTIONS(19), 1, + anon_sym_u03bb, + ACTIONS(21), 1, + anon_sym_fun, + ACTIONS(23), 1, + anon_sym_u220f, + ACTIONS(25), 1, + anon_sym_forall, + STATE(14), 1, + sym_square, + STATE(24), 1, + sym_app_term, + STATE(25), 1, + sym_arrow, + STATE(50), 1, + sym_expr, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + ACTIONS(17), 2, + anon_sym_u25a1, + anon_sym_LBRACK_RBRACK, + STATE(12), 2, + sym_term, + aux_sym_app_repeat1, + STATE(26), 3, + sym_labs, + sym_pabs, + sym_app, + [102] = 15, + ACTIONS(11), 1, + sym_identifier, + ACTIONS(13), 1, + anon_sym_LPAREN, + ACTIONS(15), 1, + sym_star, + ACTIONS(19), 1, + anon_sym_u03bb, + ACTIONS(21), 1, + anon_sym_fun, + ACTIONS(23), 1, + anon_sym_u220f, + ACTIONS(25), 1, + anon_sym_forall, + STATE(14), 1, + sym_square, + STATE(24), 1, + sym_app_term, + STATE(25), 1, + sym_arrow, + STATE(41), 1, + sym_expr, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + ACTIONS(17), 2, + anon_sym_u25a1, + anon_sym_LBRACK_RBRACK, + STATE(12), 2, + sym_term, + aux_sym_app_repeat1, + STATE(26), 3, + sym_labs, + sym_pabs, + sym_app, + [153] = 15, + ACTIONS(11), 1, + sym_identifier, + ACTIONS(13), 1, + anon_sym_LPAREN, + ACTIONS(15), 1, + sym_star, + ACTIONS(19), 1, + anon_sym_u03bb, + ACTIONS(21), 1, + anon_sym_fun, + ACTIONS(23), 1, + anon_sym_u220f, + ACTIONS(25), 1, + anon_sym_forall, + STATE(14), 1, + sym_square, + STATE(24), 1, + sym_app_term, + STATE(25), 1, + sym_arrow, + STATE(51), 1, + sym_expr, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + ACTIONS(17), 2, + anon_sym_u25a1, + anon_sym_LBRACK_RBRACK, + STATE(12), 2, + sym_term, + aux_sym_app_repeat1, + STATE(26), 3, + sym_labs, + sym_pabs, + sym_app, + [204] = 15, + ACTIONS(11), 1, + sym_identifier, + ACTIONS(13), 1, + anon_sym_LPAREN, + ACTIONS(15), 1, + sym_star, + ACTIONS(19), 1, + anon_sym_u03bb, + ACTIONS(21), 1, + anon_sym_fun, + ACTIONS(23), 1, + anon_sym_u220f, + ACTIONS(25), 1, + anon_sym_forall, + STATE(14), 1, + sym_square, + STATE(24), 1, + sym_app_term, + STATE(25), 1, + sym_arrow, + STATE(30), 1, + sym_expr, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + ACTIONS(17), 2, + anon_sym_u25a1, + anon_sym_LBRACK_RBRACK, + STATE(12), 2, + sym_term, + aux_sym_app_repeat1, + STATE(26), 3, + sym_labs, + sym_pabs, + sym_app, + [255] = 15, + ACTIONS(11), 1, + sym_identifier, + ACTIONS(13), 1, + anon_sym_LPAREN, + ACTIONS(15), 1, + sym_star, + ACTIONS(19), 1, + anon_sym_u03bb, + ACTIONS(21), 1, + anon_sym_fun, + ACTIONS(23), 1, + anon_sym_u220f, + ACTIONS(25), 1, + anon_sym_forall, + STATE(14), 1, + sym_square, + STATE(24), 1, + sym_app_term, + STATE(25), 1, + sym_arrow, + STATE(28), 1, + sym_expr, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + ACTIONS(17), 2, + anon_sym_u25a1, + anon_sym_LBRACK_RBRACK, + STATE(12), 2, + sym_term, + aux_sym_app_repeat1, + STATE(26), 3, + sym_labs, + sym_pabs, + sym_app, + [306] = 15, + ACTIONS(11), 1, + sym_identifier, + ACTIONS(13), 1, + anon_sym_LPAREN, + ACTIONS(15), 1, + sym_star, + ACTIONS(19), 1, + anon_sym_u03bb, + ACTIONS(21), 1, + anon_sym_fun, + ACTIONS(23), 1, + anon_sym_u220f, + ACTIONS(25), 1, + anon_sym_forall, + STATE(14), 1, + sym_square, + STATE(24), 1, + sym_app_term, + STATE(25), 1, + sym_arrow, + STATE(29), 1, + sym_expr, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + ACTIONS(17), 2, + anon_sym_u25a1, + anon_sym_LBRACK_RBRACK, + STATE(12), 2, + sym_term, + aux_sym_app_repeat1, + STATE(26), 3, + sym_labs, + sym_pabs, + sym_app, + [357] = 7, + ACTIONS(13), 1, + anon_sym_LPAREN, + STATE(14), 1, sym_square, ACTIONS(3), 2, sym_comment, sym_block_comment, - ACTIONS(13), 2, - sym_identifier, - sym_star, ACTIONS(15), 2, + sym_identifier, + sym_star, + ACTIONS(17), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, STATE(13), 2, sym_term, aux_sym_app_repeat1, - ACTIONS(31), 5, + ACTIONS(33), 5, anon_sym_RPAREN, anon_sym_DASH_GT, anon_sym_u2192, anon_sym_COLON_EQ, anon_sym_SEMI, - [30] = 7, - ACTIONS(36), 1, + [387] = 7, + ACTIONS(38), 1, anon_sym_LPAREN, - STATE(15), 1, + STATE(14), 1, sym_square, ACTIONS(3), 2, sym_comment, sym_block_comment, - ACTIONS(33), 2, + ACTIONS(35), 2, sym_identifier, sym_star, - ACTIONS(41), 2, + ACTIONS(43), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, STATE(13), 2, sym_term, aux_sym_app_repeat1, - ACTIONS(39), 5, + ACTIONS(41), 5, anon_sym_RPAREN, anon_sym_DASH_GT, anon_sym_u2192, anon_sym_COLON_EQ, anon_sym_SEMI, - [60] = 2, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - ACTIONS(44), 10, - sym_identifier, - anon_sym_LPAREN, - anon_sym_RPAREN, - sym_star, - anon_sym_u25a1, - anon_sym_LBRACK_RBRACK, - anon_sym_DASH_GT, - anon_sym_u2192, - anon_sym_COLON_EQ, - anon_sym_SEMI, - [77] = 2, + [417] = 2, ACTIONS(3), 2, sym_comment, sym_block_comment, @@ -1042,7 +1241,7 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_u2192, anon_sym_COLON_EQ, anon_sym_SEMI, - [94] = 2, + [434] = 2, ACTIONS(3), 2, sym_comment, sym_block_comment, @@ -1057,10 +1256,25 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_u2192, anon_sym_COLON_EQ, anon_sym_SEMI, - [111] = 5, - ACTIONS(50), 1, + [451] = 2, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + ACTIONS(50), 10, + sym_identifier, anon_sym_LPAREN, - ACTIONS(53), 1, + anon_sym_RPAREN, + sym_star, + anon_sym_u25a1, + anon_sym_LBRACK_RBRACK, + anon_sym_DASH_GT, + anon_sym_u2192, + anon_sym_COLON_EQ, + anon_sym_SEMI, + [468] = 5, + ACTIONS(52), 1, + anon_sym_LPAREN, + ACTIONS(55), 1, anon_sym_COLON, ACTIONS(3), 2, sym_comment, @@ -1068,34 +1282,48 @@ static const uint16_t ts_small_parse_table[] = { STATE(17), 2, sym_param_block, aux_sym_labs_repeat1, - ACTIONS(55), 4, + ACTIONS(57), 4, anon_sym_EQ_GT, anon_sym_u21d2, anon_sym_COMMA, anon_sym_COLON_EQ, - [132] = 6, - ACTIONS(57), 1, - anon_sym_LPAREN, + [489] = 5, + ACTIONS(7), 1, + sym_identifier, + ACTIONS(9), 1, + sym_command, ACTIONS(59), 1, - anon_sym_COLON, + ts_builtin_sym_end, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + STATE(22), 3, + sym_definition, + sym_preprocess, + aux_sym_program_repeat1, + [508] = 6, ACTIONS(61), 1, + anon_sym_LPAREN, + ACTIONS(63), 1, + anon_sym_COLON, + ACTIONS(65), 1, anon_sym_COLON_EQ, - STATE(49), 1, + STATE(44), 1, sym_ascription, ACTIONS(3), 2, sym_comment, sym_block_comment, - STATE(19), 2, + STATE(20), 2, sym_param_block, aux_sym_labs_repeat1, - [153] = 6, - ACTIONS(57), 1, + [529] = 6, + ACTIONS(61), 1, anon_sym_LPAREN, - ACTIONS(59), 1, - anon_sym_COLON, ACTIONS(63), 1, + anon_sym_COLON, + ACTIONS(67), 1, anon_sym_COLON_EQ, - STATE(47), 1, + STATE(42), 1, sym_ascription, ACTIONS(3), 2, sym_comment, @@ -1103,19 +1331,7 @@ static const uint16_t ts_small_parse_table[] = { STATE(17), 2, sym_param_block, aux_sym_labs_repeat1, - [174] = 3, - ACTIONS(67), 1, - anon_sym_COLON, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - ACTIONS(65), 5, - anon_sym_LPAREN, - anon_sym_EQ_GT, - anon_sym_u21d2, - anon_sym_COMMA, - anon_sym_COLON_EQ, - [189] = 3, + [550] = 3, ACTIONS(71), 1, anon_sym_COLON, ACTIONS(3), 2, @@ -1127,70 +1343,44 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_u21d2, anon_sym_COMMA, anon_sym_COLON_EQ, - [204] = 3, + [565] = 5, + ACTIONS(73), 1, + ts_builtin_sym_end, + ACTIONS(75), 1, + sym_identifier, + ACTIONS(78), 1, + sym_command, ACTIONS(3), 2, sym_comment, sym_block_comment, - ACTIONS(75), 2, - anon_sym_DASH_GT, - anon_sym_u2192, - ACTIONS(73), 3, - anon_sym_RPAREN, - anon_sym_COLON_EQ, - anon_sym_SEMI, - [218] = 2, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - ACTIONS(77), 5, - anon_sym_RPAREN, - anon_sym_DASH_GT, - anon_sym_u2192, - anon_sym_COLON_EQ, - anon_sym_SEMI, - [230] = 2, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - ACTIONS(73), 5, - anon_sym_RPAREN, - anon_sym_DASH_GT, - anon_sym_u2192, - anon_sym_COLON_EQ, - anon_sym_SEMI, - [242] = 4, - ACTIONS(57), 1, - anon_sym_LPAREN, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - ACTIONS(79), 2, - anon_sym_EQ_GT, - anon_sym_u21d2, - STATE(17), 2, - sym_param_block, - aux_sym_labs_repeat1, - [258] = 2, + STATE(22), 3, + sym_definition, + sym_preprocess, + aux_sym_program_repeat1, + [584] = 3, + ACTIONS(83), 1, + anon_sym_COLON, ACTIONS(3), 2, sym_comment, sym_block_comment, ACTIONS(81), 5, - anon_sym_RPAREN, - anon_sym_DASH_GT, - anon_sym_u2192, + anon_sym_LPAREN, + anon_sym_EQ_GT, + anon_sym_u21d2, + anon_sym_COMMA, anon_sym_COLON_EQ, - anon_sym_SEMI, - [270] = 2, + [599] = 3, ACTIONS(3), 2, sym_comment, sym_block_comment, - ACTIONS(83), 5, - anon_sym_RPAREN, + ACTIONS(87), 2, anon_sym_DASH_GT, anon_sym_u2192, + ACTIONS(85), 3, + anon_sym_RPAREN, anon_sym_COLON_EQ, anon_sym_SEMI, - [282] = 2, + [613] = 2, ACTIONS(3), 2, sym_comment, sym_block_comment, @@ -1200,10 +1390,62 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_u2192, anon_sym_COLON_EQ, anon_sym_SEMI, - [294] = 4, - ACTIONS(57), 1, + [625] = 2, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + ACTIONS(89), 5, + anon_sym_RPAREN, + anon_sym_DASH_GT, + anon_sym_u2192, + anon_sym_COLON_EQ, + anon_sym_SEMI, + [637] = 4, + ACTIONS(61), 1, anon_sym_LPAREN, - ACTIONS(87), 1, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + ACTIONS(91), 2, + anon_sym_EQ_GT, + anon_sym_u21d2, + STATE(17), 2, + sym_param_block, + aux_sym_labs_repeat1, + [653] = 2, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + ACTIONS(93), 5, + anon_sym_RPAREN, + anon_sym_DASH_GT, + anon_sym_u2192, + anon_sym_COLON_EQ, + anon_sym_SEMI, + [665] = 2, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + ACTIONS(95), 5, + anon_sym_RPAREN, + anon_sym_DASH_GT, + anon_sym_u2192, + anon_sym_COLON_EQ, + anon_sym_SEMI, + [677] = 2, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + ACTIONS(97), 5, + anon_sym_RPAREN, + anon_sym_DASH_GT, + anon_sym_u2192, + anon_sym_COLON_EQ, + anon_sym_SEMI, + [689] = 4, + ACTIONS(61), 1, + anon_sym_LPAREN, + ACTIONS(99), 1, anon_sym_COMMA, ACTIONS(3), 2, sym_comment, @@ -1211,198 +1453,202 @@ static const uint16_t ts_small_parse_table[] = { STATE(17), 2, sym_param_block, aux_sym_labs_repeat1, - [309] = 4, - ACTIONS(89), 1, - ts_builtin_sym_end, - ACTIONS(91), 1, + [704] = 4, + ACTIONS(101), 1, sym_identifier, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - STATE(30), 2, - sym_definition, - aux_sym_program_repeat1, - [324] = 4, - ACTIONS(7), 1, - sym_identifier, - ACTIONS(94), 1, - ts_builtin_sym_end, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - STATE(30), 2, - sym_definition, - aux_sym_program_repeat1, - [339] = 4, - ACTIONS(96), 1, - sym_identifier, - ACTIONS(98), 1, + ACTIONS(103), 1, anon_sym_COLON, - STATE(33), 1, + STATE(36), 1, aux_sym_param_block_repeat1, ACTIONS(3), 2, sym_comment, sym_block_comment, - [353] = 4, - ACTIONS(100), 1, - sym_identifier, - ACTIONS(102), 1, - anon_sym_COLON, - STATE(34), 1, - aux_sym_param_block_repeat1, + [718] = 3, + ACTIONS(61), 1, + anon_sym_LPAREN, ACTIONS(3), 2, sym_comment, sym_block_comment, - [367] = 4, - ACTIONS(104), 1, + STATE(27), 2, + sym_param_block, + aux_sym_labs_repeat1, + [730] = 4, + ACTIONS(105), 1, sym_identifier, ACTIONS(107), 1, anon_sym_COLON, - STATE(34), 1, + STATE(32), 1, aux_sym_param_block_repeat1, ACTIONS(3), 2, sym_comment, sym_block_comment, - [381] = 3, - ACTIONS(57), 1, + [744] = 3, + ACTIONS(61), 1, anon_sym_LPAREN, ACTIONS(3), 2, sym_comment, sym_block_comment, - STATE(25), 2, + STATE(31), 2, sym_param_block, aux_sym_labs_repeat1, - [393] = 3, - ACTIONS(57), 1, - anon_sym_LPAREN, + [756] = 4, + ACTIONS(109), 1, + sym_identifier, + ACTIONS(112), 1, + anon_sym_COLON, + STATE(36), 1, + aux_sym_param_block_repeat1, ACTIONS(3), 2, sym_comment, sym_block_comment, - STATE(29), 2, - sym_param_block, - aux_sym_labs_repeat1, - [405] = 2, + [770] = 2, ACTIONS(3), 2, sym_comment, sym_block_comment, - ACTIONS(109), 2, + ACTIONS(114), 3, ts_builtin_sym_end, sym_identifier, - [414] = 2, + sym_command, + [780] = 2, ACTIONS(3), 2, sym_comment, sym_block_comment, - ACTIONS(111), 2, + ACTIONS(116), 3, ts_builtin_sym_end, sym_identifier, - [423] = 2, + sym_command, + [790] = 2, ACTIONS(3), 2, sym_comment, sym_block_comment, - ACTIONS(113), 2, + ACTIONS(118), 3, ts_builtin_sym_end, sym_identifier, - [432] = 2, - ACTIONS(115), 1, - anon_sym_SEMI, + sym_command, + [800] = 2, ACTIONS(3), 2, sym_comment, sym_block_comment, - [440] = 2, - ACTIONS(117), 1, + ACTIONS(120), 3, + ts_builtin_sym_end, + sym_identifier, + sym_command, + [810] = 2, + ACTIONS(122), 1, anon_sym_RPAREN, ACTIONS(3), 2, sym_comment, sym_block_comment, - [448] = 2, - ACTIONS(119), 1, + [818] = 2, + ACTIONS(124), 1, + anon_sym_COLON_EQ, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + [826] = 2, + ACTIONS(126), 1, + anon_sym_SEMI, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + [834] = 2, + ACTIONS(67), 1, + anon_sym_COLON_EQ, + ACTIONS(3), 2, + sym_comment, + sym_block_comment, + [842] = 2, + ACTIONS(128), 1, ts_builtin_sym_end, ACTIONS(3), 2, sym_comment, sym_block_comment, - [456] = 2, - ACTIONS(121), 1, - anon_sym_COLON_EQ, - ACTIONS(3), 2, + [850] = 2, + ACTIONS(132), 1, + sym_post_command, + ACTIONS(130), 2, sym_comment, sym_block_comment, - [464] = 2, - ACTIONS(123), 1, + [858] = 2, + ACTIONS(134), 1, anon_sym_SEMI, ACTIONS(3), 2, sym_comment, sym_block_comment, - [472] = 2, - ACTIONS(125), 1, + [866] = 2, + ACTIONS(136), 1, anon_sym_SEMI, ACTIONS(3), 2, sym_comment, sym_block_comment, - [480] = 2, - ACTIONS(127), 1, - anon_sym_RPAREN, - ACTIONS(3), 2, - sym_comment, - sym_block_comment, - [488] = 2, - ACTIONS(129), 1, + [874] = 2, + ACTIONS(138), 1, anon_sym_COLON_EQ, ACTIONS(3), 2, sym_comment, sym_block_comment, - [496] = 2, - ACTIONS(131), 1, + [882] = 2, + ACTIONS(140), 1, anon_sym_RPAREN, ACTIONS(3), 2, sym_comment, sym_block_comment, - [504] = 2, - ACTIONS(63), 1, - anon_sym_COLON_EQ, + [890] = 2, + ACTIONS(142), 1, + anon_sym_RPAREN, ACTIONS(3), 2, sym_comment, sym_block_comment, }; static const uint32_t ts_small_parse_table_map[] = { - [SMALL_STATE(12)] = 0, - [SMALL_STATE(13)] = 30, - [SMALL_STATE(14)] = 60, - [SMALL_STATE(15)] = 77, - [SMALL_STATE(16)] = 94, - [SMALL_STATE(17)] = 111, - [SMALL_STATE(18)] = 132, - [SMALL_STATE(19)] = 153, - [SMALL_STATE(20)] = 174, - [SMALL_STATE(21)] = 189, - [SMALL_STATE(22)] = 204, - [SMALL_STATE(23)] = 218, - [SMALL_STATE(24)] = 230, - [SMALL_STATE(25)] = 242, - [SMALL_STATE(26)] = 258, - [SMALL_STATE(27)] = 270, - [SMALL_STATE(28)] = 282, - [SMALL_STATE(29)] = 294, - [SMALL_STATE(30)] = 309, - [SMALL_STATE(31)] = 324, - [SMALL_STATE(32)] = 339, - [SMALL_STATE(33)] = 353, - [SMALL_STATE(34)] = 367, - [SMALL_STATE(35)] = 381, - [SMALL_STATE(36)] = 393, - [SMALL_STATE(37)] = 405, - [SMALL_STATE(38)] = 414, - [SMALL_STATE(39)] = 423, - [SMALL_STATE(40)] = 432, - [SMALL_STATE(41)] = 440, - [SMALL_STATE(42)] = 448, - [SMALL_STATE(43)] = 456, - [SMALL_STATE(44)] = 464, - [SMALL_STATE(45)] = 472, - [SMALL_STATE(46)] = 480, - [SMALL_STATE(47)] = 488, - [SMALL_STATE(48)] = 496, - [SMALL_STATE(49)] = 504, + [SMALL_STATE(5)] = 0, + [SMALL_STATE(6)] = 51, + [SMALL_STATE(7)] = 102, + [SMALL_STATE(8)] = 153, + [SMALL_STATE(9)] = 204, + [SMALL_STATE(10)] = 255, + [SMALL_STATE(11)] = 306, + [SMALL_STATE(12)] = 357, + [SMALL_STATE(13)] = 387, + [SMALL_STATE(14)] = 417, + [SMALL_STATE(15)] = 434, + [SMALL_STATE(16)] = 451, + [SMALL_STATE(17)] = 468, + [SMALL_STATE(18)] = 489, + [SMALL_STATE(19)] = 508, + [SMALL_STATE(20)] = 529, + [SMALL_STATE(21)] = 550, + [SMALL_STATE(22)] = 565, + [SMALL_STATE(23)] = 584, + [SMALL_STATE(24)] = 599, + [SMALL_STATE(25)] = 613, + [SMALL_STATE(26)] = 625, + [SMALL_STATE(27)] = 637, + [SMALL_STATE(28)] = 653, + [SMALL_STATE(29)] = 665, + [SMALL_STATE(30)] = 677, + [SMALL_STATE(31)] = 689, + [SMALL_STATE(32)] = 704, + [SMALL_STATE(33)] = 718, + [SMALL_STATE(34)] = 730, + [SMALL_STATE(35)] = 744, + [SMALL_STATE(36)] = 756, + [SMALL_STATE(37)] = 770, + [SMALL_STATE(38)] = 780, + [SMALL_STATE(39)] = 790, + [SMALL_STATE(40)] = 800, + [SMALL_STATE(41)] = 810, + [SMALL_STATE(42)] = 818, + [SMALL_STATE(43)] = 826, + [SMALL_STATE(44)] = 834, + [SMALL_STATE(45)] = 842, + [SMALL_STATE(46)] = 850, + [SMALL_STATE(47)] = 858, + [SMALL_STATE(48)] = 866, + [SMALL_STATE(49)] = 874, + [SMALL_STATE(50)] = 882, + [SMALL_STATE(51)] = 890, }; static const TSParseActionEntry ts_parse_actions[] = { @@ -1410,66 +1656,71 @@ static const TSParseActionEntry ts_parse_actions[] = { [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), [3] = {.entry = {.count = 1, .reusable = true}}, SHIFT_EXTRA(), [5] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_program, 0, 0, 0), - [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), - [9] = {.entry = {.count = 1, .reusable = false}}, SHIFT(15), - [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), - [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), - [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), - [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), - [19] = {.entry = {.count = 1, .reusable = false}}, SHIFT(35), - [21] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), - [23] = {.entry = {.count = 1, .reusable = false}}, SHIFT(36), - [25] = {.entry = {.count = 1, .reusable = false}}, SHIFT(44), - [27] = {.entry = {.count = 1, .reusable = false}}, SHIFT(40), - [29] = {.entry = {.count = 1, .reusable = false}}, SHIFT(45), - [31] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_app, 1, 0, 0), - [33] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), SHIFT_REPEAT(15), - [36] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), SHIFT_REPEAT(8), - [39] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), - [41] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), SHIFT_REPEAT(16), - [44] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_term, 3, 0, 0), + [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), + [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(46), + [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(14), + [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), + [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), + [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), + [19] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33), + [21] = {.entry = {.count = 1, .reusable = false}}, SHIFT(33), + [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), + [25] = {.entry = {.count = 1, .reusable = false}}, SHIFT(35), + [27] = {.entry = {.count = 1, .reusable = false}}, SHIFT(43), + [29] = {.entry = {.count = 1, .reusable = false}}, SHIFT(48), + [31] = {.entry = {.count = 1, .reusable = false}}, SHIFT(47), + [33] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_app, 1, 0, 0), + [35] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), SHIFT_REPEAT(14), + [38] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), SHIFT_REPEAT(6), + [41] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), + [43] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_app_repeat1, 2, 0, 0), SHIFT_REPEAT(15), [46] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_term, 1, 0, 0), [48] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_square, 1, 0, 0), - [50] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_labs_repeat1, 2, 0, 0), SHIFT_REPEAT(32), - [53] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_labs_repeat1, 2, 0, 0), - [55] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_labs_repeat1, 2, 0, 0), - [57] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), - [59] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5), - [61] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3), - [63] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2), - [65] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param_block, 4, 0, 3), - [67] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_param_block, 4, 0, 3), + [50] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_term, 3, 0, 0), + [52] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_labs_repeat1, 2, 0, 0), SHIFT_REPEAT(34), + [55] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_labs_repeat1, 2, 0, 0), + [57] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_labs_repeat1, 2, 0, 0), + [59] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_program, 1, 0, 0), + [61] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), + [63] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5), + [65] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2), + [67] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3), [69] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param_block, 5, 0, 4), [71] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_param_block, 5, 0, 4), - [73] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expr, 1, 0, 0), - [75] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), - [77] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_app_term, 1, 0, 0), - [79] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), - [81] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pabs, 4, 0, 0), - [83] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_labs, 4, 0, 0), - [85] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_arrow, 3, 0, 0), - [87] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), - [89] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2, 0, 0), - [91] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2, 0, 0), SHIFT_REPEAT(18), - [94] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_program, 1, 0, 0), - [96] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33), - [98] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), - [100] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), - [102] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), - [104] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_param_block_repeat1, 2, 0, 0), SHIFT_REPEAT(34), - [107] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_param_block_repeat1, 2, 0, 0), - [109] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition, 4, 0, 2), - [111] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition, 5, 0, 2), - [113] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition, 6, 0, 2), - [115] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), - [117] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), - [119] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), - [121] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_ascription, 2, 0, 1), - [123] = {.entry = {.count = 1, .reusable = true}}, SHIFT(38), - [125] = {.entry = {.count = 1, .reusable = true}}, SHIFT(39), - [127] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), - [129] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), - [131] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), + [73] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2, 0, 0), + [75] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2, 0, 0), SHIFT_REPEAT(19), + [78] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2, 0, 0), SHIFT_REPEAT(46), + [81] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_param_block, 4, 0, 3), + [83] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_param_block, 4, 0, 3), + [85] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expr, 1, 0, 0), + [87] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), + [89] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_app_term, 1, 0, 0), + [91] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), + [93] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_labs, 4, 0, 0), + [95] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pabs, 4, 0, 0), + [97] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_arrow, 3, 0, 0), + [99] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [101] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), + [103] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), + [105] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), + [107] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), + [109] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_param_block_repeat1, 2, 0, 0), SHIFT_REPEAT(36), + [112] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_param_block_repeat1, 2, 0, 0), + [114] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition, 5, 0, 2), + [116] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition, 4, 0, 2), + [118] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_preprocess, 2, 0, 0), + [120] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_definition, 6, 0, 2), + [122] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), + [124] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), + [126] = {.entry = {.count = 1, .reusable = true}}, SHIFT(38), + [128] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [130] = {.entry = {.count = 1, .reusable = false}}, SHIFT_EXTRA(), + [132] = {.entry = {.count = 1, .reusable = false}}, SHIFT(39), + [134] = {.entry = {.count = 1, .reusable = true}}, SHIFT(40), + [136] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), + [138] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_ascription, 2, 0, 1), + [140] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), + [142] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), }; #ifdef __cplusplus diff --git a/test/corpus/include.txt b/test/corpus/include.txt new file mode 100644 index 0000000..ec2b3c9 --- /dev/null +++ b/test/corpus/include.txt @@ -0,0 +1,32 @@ +======= +Include +======= + +@include foo.pg + +baz : * := A; + +@include bar.pg + +--- + +(program + (preprocess + (command) + (post_command)) + (definition + (identifier) + (ascription + (expr + (app_term + (app + (term + (star)))))) + (expr + (app_term + (app + (term + (identifier)))))) + (preprocess + (command) + (post_command)))