#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 50 #define LARGE_STATE_COUNT 5 #define SYMBOL_COUNT 37 #define ALIAS_COUNT 0 #define TOKEN_COUNT 21 #define EXTERNAL_TOKEN_COUNT 0 #define FIELD_COUNT 3 #define MAX_ALIAS_SEQUENCE_LENGTH 6 #define PRODUCTION_ID_COUNT 5 enum ts_symbol_identifiers { sym_identifier = 1, sym_comment = 2, anon_sym_LPAREN = 3, anon_sym_COLON = 4, anon_sym_RPAREN = 5, sym_star = 6, anon_sym_u25a1 = 7, anon_sym_LBRACK_RBRACK = 8, anon_sym_u03bb = 9, anon_sym_fun = 10, anon_sym_EQ_GT = 11, anon_sym_u21d2 = 12, anon_sym_u220f = 13, anon_sym_forall = 14, anon_sym_COMMA = 15, sym_axiom = 16, anon_sym_DASH_GT = 17, anon_sym_u2192 = 18, anon_sym_COLON_EQ = 19, anon_sym_SEMI = 20, sym_program = 21, sym_param_block = 22, sym_square = 23, sym_labs = 24, sym_pabs = 25, sym_term = 26, sym_app = 27, sym_arrow = 28, sym_app_term = 29, sym_expr = 30, sym_ascription = 31, sym_definition = 32, aux_sym_program_repeat1 = 33, aux_sym_param_block_repeat1 = 34, aux_sym_labs_repeat1 = 35, aux_sym_app_repeat1 = 36, }; static const char * const ts_symbol_names[] = { [ts_builtin_sym_end] = "end", [sym_identifier] = "identifier", [sym_comment] = "comment", [anon_sym_LPAREN] = "(", [anon_sym_COLON] = ":", [anon_sym_RPAREN] = ")", [sym_star] = "star", [anon_sym_u25a1] = "\u25a1", [anon_sym_LBRACK_RBRACK] = "[]", [anon_sym_u03bb] = "\u03bb", [anon_sym_fun] = "fun", [anon_sym_EQ_GT] = "=>", [anon_sym_u21d2] = "\u21d2", [anon_sym_u220f] = "\u220f", [anon_sym_forall] = "forall", [anon_sym_COMMA] = ",", [sym_axiom] = "axiom", [anon_sym_DASH_GT] = "->", [anon_sym_u2192] = "\u2192", [anon_sym_COLON_EQ] = ":=", [anon_sym_SEMI] = ";", [sym_program] = "program", [sym_param_block] = "param_block", [sym_square] = "square", [sym_labs] = "labs", [sym_pabs] = "pabs", [sym_term] = "term", [sym_app] = "app", [sym_arrow] = "arrow", [sym_app_term] = "app_term", [sym_expr] = "expr", [sym_ascription] = "ascription", [sym_definition] = "definition", [aux_sym_program_repeat1] = "program_repeat1", [aux_sym_param_block_repeat1] = "param_block_repeat1", [aux_sym_labs_repeat1] = "labs_repeat1", [aux_sym_app_repeat1] = "app_repeat1", }; static const TSSymbol ts_symbol_map[] = { [ts_builtin_sym_end] = ts_builtin_sym_end, [sym_identifier] = sym_identifier, [sym_comment] = sym_comment, [anon_sym_LPAREN] = anon_sym_LPAREN, [anon_sym_COLON] = anon_sym_COLON, [anon_sym_RPAREN] = anon_sym_RPAREN, [sym_star] = sym_star, [anon_sym_u25a1] = anon_sym_u25a1, [anon_sym_LBRACK_RBRACK] = anon_sym_LBRACK_RBRACK, [anon_sym_u03bb] = anon_sym_u03bb, [anon_sym_fun] = anon_sym_fun, [anon_sym_EQ_GT] = anon_sym_EQ_GT, [anon_sym_u21d2] = anon_sym_u21d2, [anon_sym_u220f] = anon_sym_u220f, [anon_sym_forall] = anon_sym_forall, [anon_sym_COMMA] = anon_sym_COMMA, [sym_axiom] = sym_axiom, [anon_sym_DASH_GT] = anon_sym_DASH_GT, [anon_sym_u2192] = anon_sym_u2192, [anon_sym_COLON_EQ] = anon_sym_COLON_EQ, [anon_sym_SEMI] = anon_sym_SEMI, [sym_program] = sym_program, [sym_param_block] = sym_param_block, [sym_square] = sym_square, [sym_labs] = sym_labs, [sym_pabs] = sym_pabs, [sym_term] = sym_term, [sym_app] = sym_app, [sym_arrow] = sym_arrow, [sym_app_term] = sym_app_term, [sym_expr] = sym_expr, [sym_ascription] = sym_ascription, [sym_definition] = sym_definition, [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, [aux_sym_app_repeat1] = aux_sym_app_repeat1, }; static const TSSymbolMetadata ts_symbol_metadata[] = { [ts_builtin_sym_end] = { .visible = false, .named = true, }, [sym_identifier] = { .visible = true, .named = true, }, [sym_comment] = { .visible = true, .named = true, }, [anon_sym_LPAREN] = { .visible = true, .named = false, }, [anon_sym_COLON] = { .visible = true, .named = false, }, [anon_sym_RPAREN] = { .visible = true, .named = false, }, [sym_star] = { .visible = true, .named = true, }, [anon_sym_u25a1] = { .visible = true, .named = false, }, [anon_sym_LBRACK_RBRACK] = { .visible = true, .named = false, }, [anon_sym_u03bb] = { .visible = true, .named = false, }, [anon_sym_fun] = { .visible = true, .named = false, }, [anon_sym_EQ_GT] = { .visible = true, .named = false, }, [anon_sym_u21d2] = { .visible = true, .named = false, }, [anon_sym_u220f] = { .visible = true, .named = false, }, [anon_sym_forall] = { .visible = true, .named = false, }, [anon_sym_COMMA] = { .visible = true, .named = false, }, [sym_axiom] = { .visible = true, .named = true, }, [anon_sym_DASH_GT] = { .visible = true, .named = false, }, [anon_sym_u2192] = { .visible = true, .named = false, }, [anon_sym_COLON_EQ] = { .visible = true, .named = false, }, [anon_sym_SEMI] = { .visible = true, .named = false, }, [sym_program] = { .visible = true, .named = true, }, [sym_param_block] = { .visible = true, .named = true, }, [sym_square] = { .visible = true, .named = true, }, [sym_labs] = { .visible = true, .named = true, }, [sym_pabs] = { .visible = true, .named = true, }, [sym_term] = { .visible = true, .named = true, }, [sym_app] = { .visible = true, .named = true, }, [sym_arrow] = { .visible = true, .named = true, }, [sym_app_term] = { .visible = true, .named = true, }, [sym_expr] = { .visible = true, .named = true, }, [sym_ascription] = { .visible = true, .named = true, }, [sym_definition] = { .visible = true, .named = true, }, [aux_sym_program_repeat1] = { .visible = false, .named = false, }, [aux_sym_param_block_repeat1] = { .visible = false, .named = false, }, [aux_sym_labs_repeat1] = { .visible = false, .named = false, }, [aux_sym_app_repeat1] = { .visible = false, .named = false, }, }; enum ts_field_identifiers { field_name = 1, field_param = 2, field_type = 3, }; static const char * const ts_field_names[] = { [0] = NULL, [field_name] = "name", [field_param] = "param", [field_type] = "type", }; static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { [1] = {.index = 0, .length = 1}, [2] = {.index = 1, .length = 1}, [3] = {.index = 2, .length = 1}, [4] = {.index = 3, .length = 2}, }; static const TSFieldMapEntry ts_field_map_entries[] = { [0] = {field_type, 1}, [1] = {field_name, 0}, [2] = {field_type, 2}, [3] = {field_param, 1}, {field_type, 3}, }; 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, [36] = 36, [37] = 37, [38] = 38, [39] = 39, [40] = 40, [41] = 41, [42] = 42, [43] = 43, [44] = 44, [45] = 45, [46] = 46, [47] = 47, [48] = 48, [49] = 49, }; static bool ts_lex(TSLexer *lexer, TSStateId state) { START_LEXER(); eof = lexer->eof(lexer); switch (state) { case 0: if (eof) ADVANCE(6); ADVANCE_MAP( '(', 19, ')', 21, '*', 22, ',', 31, '-', 2, ':', 20, ';', 36, '=', 3, '[', 4, 'a', 16, 'f', 13, 0x3bb, 25, 0x2192, 34, 0x21d2, 28, 0x220f, 29, 0x25a1, 23, ); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(0); if (('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('b' <= lookahead && lookahead <= 'z')) ADVANCE(17); END_STATE(); case 1: if (lookahead == '(') ADVANCE(19); if (lookahead == '*') ADVANCE(22); if (lookahead == '[') ADVANCE(4); if (lookahead == 'f') ADVANCE(13); if (lookahead == 0x3bb) ADVANCE(25); if (lookahead == 0x220f) ADVANCE(29); if (lookahead == 0x25a1) ADVANCE(23); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(1); if (('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(17); END_STATE(); case 2: if (lookahead == '-') ADVANCE(18); if (lookahead == '>') ADVANCE(33); END_STATE(); case 3: if (lookahead == '>') ADVANCE(27); END_STATE(); case 4: if (lookahead == ']') ADVANCE(24); END_STATE(); case 5: if (eof) ADVANCE(6); ADVANCE_MAP( '(', 19, ')', 21, '*', 22, '-', 2, ':', 20, ';', 36, '[', 4, 0x2192, 34, 0x25a1, 23, ); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(5); if (('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(17); END_STATE(); case 6: ACCEPT_TOKEN(ts_builtin_sym_end); END_STATE(); case 7: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'a') ADVANCE(10); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('b' <= lookahead && lookahead <= 'z')) ADVANCE(17); END_STATE(); case 8: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'i') ADVANCE(14); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(17); END_STATE(); case 9: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'l') ADVANCE(30); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(17); END_STATE(); case 10: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'l') ADVANCE(9); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(17); END_STATE(); case 11: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'm') ADVANCE(32); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(17); END_STATE(); case 12: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'n') ADVANCE(26); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(17); END_STATE(); case 13: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'o') ADVANCE(15); if (lookahead == 'u') ADVANCE(12); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(17); END_STATE(); case 14: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'o') ADVANCE(11); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(17); END_STATE(); case 15: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'r') ADVANCE(7); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(17); END_STATE(); case 16: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'x') ADVANCE(8); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(17); END_STATE(); case 17: ACCEPT_TOKEN(sym_identifier); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(17); END_STATE(); case 18: ACCEPT_TOKEN(sym_comment); if (lookahead != 0 && lookahead != '\n') ADVANCE(18); END_STATE(); case 19: ACCEPT_TOKEN(anon_sym_LPAREN); END_STATE(); case 20: ACCEPT_TOKEN(anon_sym_COLON); if (lookahead == '=') ADVANCE(35); END_STATE(); case 21: ACCEPT_TOKEN(anon_sym_RPAREN); END_STATE(); case 22: ACCEPT_TOKEN(sym_star); END_STATE(); case 23: ACCEPT_TOKEN(anon_sym_u25a1); END_STATE(); case 24: ACCEPT_TOKEN(anon_sym_LBRACK_RBRACK); END_STATE(); case 25: ACCEPT_TOKEN(anon_sym_u03bb); END_STATE(); case 26: ACCEPT_TOKEN(anon_sym_fun); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(17); END_STATE(); case 27: ACCEPT_TOKEN(anon_sym_EQ_GT); END_STATE(); case 28: ACCEPT_TOKEN(anon_sym_u21d2); END_STATE(); case 29: ACCEPT_TOKEN(anon_sym_u220f); END_STATE(); case 30: ACCEPT_TOKEN(anon_sym_forall); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(17); END_STATE(); case 31: ACCEPT_TOKEN(anon_sym_COMMA); END_STATE(); case 32: ACCEPT_TOKEN(sym_axiom); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(17); END_STATE(); case 33: ACCEPT_TOKEN(anon_sym_DASH_GT); END_STATE(); case 34: ACCEPT_TOKEN(anon_sym_u2192); END_STATE(); case 35: ACCEPT_TOKEN(anon_sym_COLON_EQ); END_STATE(); case 36: ACCEPT_TOKEN(anon_sym_SEMI); END_STATE(); default: return false; } } static const TSLexMode ts_lex_modes[STATE_COUNT] = { [0] = {.lex_state = 0}, [1] = {.lex_state = 5}, [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 = 5}, [13] = {.lex_state = 5}, [14] = {.lex_state = 5}, [15] = {.lex_state = 5}, [16] = {.lex_state = 5}, [17] = {.lex_state = 0}, [18] = {.lex_state = 0}, [19] = {.lex_state = 0}, [20] = {.lex_state = 0}, [21] = {.lex_state = 0}, [22] = {.lex_state = 0}, [23] = {.lex_state = 0}, [24] = {.lex_state = 0}, [25] = {.lex_state = 0}, [26] = {.lex_state = 5}, [27] = {.lex_state = 0}, [28] = {.lex_state = 0}, [29] = {.lex_state = 0}, [30] = {.lex_state = 5}, [31] = {.lex_state = 0}, [32] = {.lex_state = 5}, [33] = {.lex_state = 5}, [34] = {.lex_state = 5}, [35] = {.lex_state = 5}, [36] = {.lex_state = 0}, [37] = {.lex_state = 5}, [38] = {.lex_state = 0}, [39] = {.lex_state = 5}, [40] = {.lex_state = 0}, [41] = {.lex_state = 0}, [42] = {.lex_state = 0}, [43] = {.lex_state = 0}, [44] = {.lex_state = 0}, [45] = {.lex_state = 0}, [46] = {.lex_state = 0}, [47] = {.lex_state = 0}, [48] = {.lex_state = 0}, [49] = {.lex_state = 0}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [0] = { [ts_builtin_sym_end] = ACTIONS(1), [sym_identifier] = ACTIONS(1), [sym_comment] = ACTIONS(1), [anon_sym_LPAREN] = ACTIONS(1), [anon_sym_COLON] = ACTIONS(1), [anon_sym_RPAREN] = ACTIONS(1), [sym_star] = ACTIONS(1), [anon_sym_u25a1] = ACTIONS(1), [anon_sym_LBRACK_RBRACK] = ACTIONS(1), [anon_sym_u03bb] = ACTIONS(1), [anon_sym_fun] = ACTIONS(1), [anon_sym_EQ_GT] = ACTIONS(1), [anon_sym_u21d2] = ACTIONS(1), [anon_sym_u220f] = ACTIONS(1), [anon_sym_forall] = ACTIONS(1), [anon_sym_COMMA] = ACTIONS(1), [sym_axiom] = ACTIONS(1), [anon_sym_DASH_GT] = ACTIONS(1), [anon_sym_u2192] = ACTIONS(1), [anon_sym_COLON_EQ] = ACTIONS(1), [anon_sym_SEMI] = ACTIONS(1), }, [1] = { [sym_program] = STATE(42), [sym_definition] = STATE(30), [aux_sym_program_repeat1] = STATE(30), [ts_builtin_sym_end] = ACTIONS(3), [sym_identifier] = ACTIONS(5), [sym_comment] = ACTIONS(7), }, [2] = { [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(44), [aux_sym_app_repeat1] = STATE(12), [sym_identifier] = ACTIONS(9), [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), [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), [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), }, }; static const uint16_t ts_small_parse_table[] = { [0] = 14, ACTIONS(9), 1, sym_identifier, ACTIONS(11), 1, anon_sym_LPAREN, ACTIONS(13), 1, sym_star, ACTIONS(17), 1, anon_sym_u03bb, ACTIONS(19), 1, anon_sym_fun, ACTIONS(21), 1, anon_sym_u220f, ACTIONS(23), 1, anon_sym_forall, STATE(15), 1, sym_square, STATE(22), 1, sym_app_term, STATE(24), 1, sym_arrow, STATE(43), 1, sym_expr, ACTIONS(15), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, STATE(12), 2, sym_term, aux_sym_app_repeat1, STATE(23), 3, sym_labs, sym_pabs, sym_app, [47] = 14, ACTIONS(9), 1, sym_identifier, ACTIONS(11), 1, anon_sym_LPAREN, ACTIONS(13), 1, sym_star, ACTIONS(17), 1, anon_sym_u03bb, ACTIONS(19), 1, anon_sym_fun, ACTIONS(21), 1, anon_sym_u220f, ACTIONS(23), 1, anon_sym_forall, STATE(15), 1, sym_square, STATE(22), 1, sym_app_term, STATE(24), 1, sym_arrow, STATE(28), 1, sym_expr, ACTIONS(15), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, STATE(12), 2, sym_term, aux_sym_app_repeat1, STATE(23), 3, sym_labs, sym_pabs, sym_app, [94] = 14, ACTIONS(9), 1, sym_identifier, ACTIONS(11), 1, anon_sym_LPAREN, ACTIONS(13), 1, sym_star, ACTIONS(17), 1, anon_sym_u03bb, ACTIONS(19), 1, anon_sym_fun, ACTIONS(21), 1, anon_sym_u220f, ACTIONS(23), 1, anon_sym_forall, STATE(15), 1, sym_square, STATE(22), 1, sym_app_term, STATE(24), 1, sym_arrow, STATE(41), 1, sym_expr, ACTIONS(15), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, STATE(12), 2, sym_term, aux_sym_app_repeat1, STATE(23), 3, sym_labs, sym_pabs, sym_app, [141] = 14, ACTIONS(9), 1, sym_identifier, ACTIONS(11), 1, anon_sym_LPAREN, ACTIONS(13), 1, sym_star, ACTIONS(17), 1, anon_sym_u03bb, ACTIONS(19), 1, anon_sym_fun, ACTIONS(21), 1, anon_sym_u220f, ACTIONS(23), 1, anon_sym_forall, STATE(15), 1, sym_square, STATE(22), 1, sym_app_term, STATE(24), 1, sym_arrow, STATE(46), 1, sym_expr, ACTIONS(15), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, STATE(12), 2, sym_term, aux_sym_app_repeat1, STATE(23), 3, sym_labs, sym_pabs, sym_app, [188] = 14, ACTIONS(9), 1, sym_identifier, ACTIONS(11), 1, anon_sym_LPAREN, ACTIONS(13), 1, sym_star, ACTIONS(17), 1, anon_sym_u03bb, ACTIONS(19), 1, anon_sym_fun, ACTIONS(21), 1, anon_sym_u220f, ACTIONS(23), 1, anon_sym_forall, STATE(15), 1, sym_square, STATE(22), 1, sym_app_term, STATE(24), 1, sym_arrow, STATE(48), 1, sym_expr, ACTIONS(15), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, STATE(12), 2, sym_term, aux_sym_app_repeat1, STATE(23), 3, sym_labs, sym_pabs, sym_app, [235] = 14, ACTIONS(9), 1, sym_identifier, ACTIONS(11), 1, anon_sym_LPAREN, ACTIONS(13), 1, sym_star, ACTIONS(17), 1, anon_sym_u03bb, ACTIONS(19), 1, anon_sym_fun, ACTIONS(21), 1, anon_sym_u220f, ACTIONS(23), 1, anon_sym_forall, STATE(15), 1, sym_square, STATE(22), 1, sym_app_term, STATE(24), 1, sym_arrow, STATE(29), 1, sym_expr, ACTIONS(15), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, STATE(12), 2, sym_term, aux_sym_app_repeat1, STATE(23), 3, sym_labs, sym_pabs, sym_app, [282] = 14, ACTIONS(9), 1, sym_identifier, ACTIONS(11), 1, anon_sym_LPAREN, ACTIONS(13), 1, sym_star, ACTIONS(17), 1, anon_sym_u03bb, ACTIONS(19), 1, anon_sym_fun, ACTIONS(21), 1, anon_sym_u220f, ACTIONS(23), 1, anon_sym_forall, STATE(15), 1, sym_square, STATE(22), 1, sym_app_term, STATE(24), 1, sym_arrow, STATE(27), 1, sym_expr, ACTIONS(15), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, STATE(12), 2, sym_term, aux_sym_app_repeat1, STATE(23), 3, sym_labs, sym_pabs, sym_app, [329] = 6, ACTIONS(11), 1, anon_sym_LPAREN, STATE(15), 1, sym_square, ACTIONS(13), 2, sym_identifier, sym_star, ACTIONS(15), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, STATE(13), 2, sym_term, aux_sym_app_repeat1, ACTIONS(31), 5, anon_sym_RPAREN, anon_sym_DASH_GT, anon_sym_u2192, anon_sym_COLON_EQ, anon_sym_SEMI, [355] = 6, ACTIONS(36), 1, anon_sym_LPAREN, STATE(15), 1, sym_square, ACTIONS(33), 2, sym_identifier, sym_star, ACTIONS(41), 2, anon_sym_u25a1, anon_sym_LBRACK_RBRACK, STATE(13), 2, sym_term, aux_sym_app_repeat1, ACTIONS(39), 5, anon_sym_RPAREN, anon_sym_DASH_GT, anon_sym_u2192, anon_sym_COLON_EQ, anon_sym_SEMI, [381] = 1, 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, [394] = 1, ACTIONS(46), 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, [407] = 1, ACTIONS(48), 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, [420] = 4, ACTIONS(50), 1, anon_sym_LPAREN, ACTIONS(53), 1, anon_sym_COLON, STATE(17), 2, sym_param_block, aux_sym_labs_repeat1, ACTIONS(55), 4, anon_sym_EQ_GT, anon_sym_u21d2, anon_sym_COMMA, anon_sym_COLON_EQ, [437] = 5, ACTIONS(57), 1, anon_sym_LPAREN, ACTIONS(59), 1, anon_sym_COLON, ACTIONS(61), 1, anon_sym_COLON_EQ, STATE(49), 1, sym_ascription, STATE(19), 2, sym_param_block, aux_sym_labs_repeat1, [454] = 5, ACTIONS(57), 1, anon_sym_LPAREN, ACTIONS(59), 1, anon_sym_COLON, ACTIONS(63), 1, anon_sym_COLON_EQ, STATE(47), 1, sym_ascription, STATE(17), 2, sym_param_block, aux_sym_labs_repeat1, [471] = 2, ACTIONS(67), 1, anon_sym_COLON, ACTIONS(65), 5, anon_sym_LPAREN, anon_sym_EQ_GT, anon_sym_u21d2, anon_sym_COMMA, anon_sym_COLON_EQ, [482] = 2, ACTIONS(71), 1, anon_sym_COLON, ACTIONS(69), 5, anon_sym_LPAREN, anon_sym_EQ_GT, anon_sym_u21d2, anon_sym_COMMA, anon_sym_COLON_EQ, [493] = 2, ACTIONS(75), 2, anon_sym_DASH_GT, anon_sym_u2192, ACTIONS(73), 3, anon_sym_RPAREN, anon_sym_COLON_EQ, anon_sym_SEMI, [503] = 1, ACTIONS(77), 5, anon_sym_RPAREN, anon_sym_DASH_GT, anon_sym_u2192, anon_sym_COLON_EQ, anon_sym_SEMI, [511] = 1, ACTIONS(73), 5, anon_sym_RPAREN, anon_sym_DASH_GT, anon_sym_u2192, anon_sym_COLON_EQ, anon_sym_SEMI, [519] = 3, ACTIONS(57), 1, anon_sym_LPAREN, ACTIONS(79), 2, anon_sym_EQ_GT, anon_sym_u21d2, STATE(17), 2, sym_param_block, aux_sym_labs_repeat1, [531] = 4, ACTIONS(81), 1, ts_builtin_sym_end, ACTIONS(83), 1, sym_identifier, ACTIONS(86), 1, sym_comment, STATE(26), 2, sym_definition, aux_sym_program_repeat1, [545] = 1, ACTIONS(89), 5, anon_sym_RPAREN, anon_sym_DASH_GT, anon_sym_u2192, anon_sym_COLON_EQ, anon_sym_SEMI, [553] = 1, ACTIONS(91), 5, anon_sym_RPAREN, anon_sym_DASH_GT, anon_sym_u2192, anon_sym_COLON_EQ, anon_sym_SEMI, [561] = 1, ACTIONS(93), 5, anon_sym_RPAREN, anon_sym_DASH_GT, anon_sym_u2192, anon_sym_COLON_EQ, anon_sym_SEMI, [569] = 4, ACTIONS(5), 1, sym_identifier, ACTIONS(95), 1, ts_builtin_sym_end, ACTIONS(97), 1, sym_comment, STATE(26), 2, sym_definition, aux_sym_program_repeat1, [583] = 3, ACTIONS(57), 1, anon_sym_LPAREN, ACTIONS(99), 1, anon_sym_COMMA, STATE(17), 2, sym_param_block, aux_sym_labs_repeat1, [594] = 3, ACTIONS(101), 1, sym_identifier, ACTIONS(103), 1, anon_sym_COLON, STATE(33), 1, aux_sym_param_block_repeat1, [604] = 3, ACTIONS(105), 1, sym_identifier, ACTIONS(107), 1, anon_sym_COLON, STATE(34), 1, aux_sym_param_block_repeat1, [614] = 3, ACTIONS(109), 1, sym_identifier, ACTIONS(112), 1, anon_sym_COLON, STATE(34), 1, aux_sym_param_block_repeat1, [624] = 1, ACTIONS(114), 3, ts_builtin_sym_end, sym_identifier, sym_comment, [630] = 2, ACTIONS(57), 1, anon_sym_LPAREN, STATE(31), 2, sym_param_block, aux_sym_labs_repeat1, [638] = 1, ACTIONS(116), 3, ts_builtin_sym_end, sym_identifier, sym_comment, [644] = 2, ACTIONS(57), 1, anon_sym_LPAREN, STATE(25), 2, sym_param_block, aux_sym_labs_repeat1, [652] = 1, ACTIONS(118), 3, ts_builtin_sym_end, sym_identifier, sym_comment, [658] = 1, ACTIONS(120), 1, anon_sym_SEMI, [662] = 1, ACTIONS(122), 1, anon_sym_RPAREN, [666] = 1, ACTIONS(124), 1, ts_builtin_sym_end, [670] = 1, ACTIONS(126), 1, anon_sym_COLON_EQ, [674] = 1, ACTIONS(128), 1, anon_sym_SEMI, [678] = 1, ACTIONS(130), 1, anon_sym_SEMI, [682] = 1, ACTIONS(132), 1, anon_sym_RPAREN, [686] = 1, ACTIONS(134), 1, anon_sym_COLON_EQ, [690] = 1, ACTIONS(136), 1, anon_sym_RPAREN, [694] = 1, ACTIONS(63), 1, anon_sym_COLON_EQ, }; static const uint32_t ts_small_parse_table_map[] = { [SMALL_STATE(5)] = 0, [SMALL_STATE(6)] = 47, [SMALL_STATE(7)] = 94, [SMALL_STATE(8)] = 141, [SMALL_STATE(9)] = 188, [SMALL_STATE(10)] = 235, [SMALL_STATE(11)] = 282, [SMALL_STATE(12)] = 329, [SMALL_STATE(13)] = 355, [SMALL_STATE(14)] = 381, [SMALL_STATE(15)] = 394, [SMALL_STATE(16)] = 407, [SMALL_STATE(17)] = 420, [SMALL_STATE(18)] = 437, [SMALL_STATE(19)] = 454, [SMALL_STATE(20)] = 471, [SMALL_STATE(21)] = 482, [SMALL_STATE(22)] = 493, [SMALL_STATE(23)] = 503, [SMALL_STATE(24)] = 511, [SMALL_STATE(25)] = 519, [SMALL_STATE(26)] = 531, [SMALL_STATE(27)] = 545, [SMALL_STATE(28)] = 553, [SMALL_STATE(29)] = 561, [SMALL_STATE(30)] = 569, [SMALL_STATE(31)] = 583, [SMALL_STATE(32)] = 594, [SMALL_STATE(33)] = 604, [SMALL_STATE(34)] = 614, [SMALL_STATE(35)] = 624, [SMALL_STATE(36)] = 630, [SMALL_STATE(37)] = 638, [SMALL_STATE(38)] = 644, [SMALL_STATE(39)] = 652, [SMALL_STATE(40)] = 658, [SMALL_STATE(41)] = 662, [SMALL_STATE(42)] = 666, [SMALL_STATE(43)] = 670, [SMALL_STATE(44)] = 674, [SMALL_STATE(45)] = 678, [SMALL_STATE(46)] = 682, [SMALL_STATE(47)] = 686, [SMALL_STATE(48)] = 690, [SMALL_STATE(49)] = 694, }; 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_program, 0, 0, 0), [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30), [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(38), [19] = {.entry = {.count = 1, .reusable = false}}, SHIFT(38), [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), [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), [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(aux_sym_program_repeat1, 2, 0, 0), [83] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2, 0, 0), SHIFT_REPEAT(18), [86] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_program_repeat1, 2, 0, 0), SHIFT_REPEAT(26), [89] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_labs, 4, 0, 0), [91] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pabs, 4, 0, 0), [93] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_arrow, 3, 0, 0), [95] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_program, 1, 0, 0), [97] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), [99] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), [101] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33), [103] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), [105] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), [107] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), [109] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_param_block_repeat1, 2, 0, 0), SHIFT_REPEAT(34), [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_definition, 6, 0, 2), [120] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), [122] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), [124] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), [126] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_ascription, 2, 0, 1), [128] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), [130] = {.entry = {.count = 1, .reusable = true}}, SHIFT(39), [132] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), [134] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), [136] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), }; #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_perga(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, .field_names = ts_field_names, .field_map_slices = ts_field_map_slices, .field_map_entries = ts_field_map_entries, .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