From ea4f990c466bef64e161293bcf7a63b8a636145c Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 2 Jul 2023 22:47:31 +0300 Subject: [PATCH 01/11] add labels tests --- grammar.js | 7 +- src/grammar.json | 16 +- src/node-types.json | 27 +- src/parser.c | 1288 +++++++++++++++++++++++++++++----------- test/corpus/labels.txt | 18 + test/corpus/shapes.txt | 3 +- 6 files changed, 989 insertions(+), 370 deletions(-) create mode 100644 test/corpus/labels.txt diff --git a/grammar.js b/grammar.js index 59d822f..12d062f 100644 --- a/grammar.js +++ b/grammar.js @@ -30,7 +30,7 @@ module.exports = grammar({ $.identifier, ))), - shape_label: $ => seq(":", choice( + shape_label: _ => seq(":", choice( seq("|", /.+/, "|"), /.+/, )), @@ -58,8 +58,7 @@ module.exports = grammar({ identifier: $ => seq( $._ident_regex, - // repeat(seq(/\s+/, $._ident_regex)), - // optional($.sub_identifier), + optional($.sub_identifier), ), sub_identifier: $ => seq(".", $.identifier), @@ -71,7 +70,7 @@ module.exports = grammar({ seq("<", repeat1("-"), ">"), )), - param_value: _ => /[\w\-_]+/i, + // param_value: _ => /[\w\-_]+/i, // const-like rules diff --git a/src/grammar.json b/src/grammar.json index a2d62dc..f57271e 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -155,6 +155,18 @@ { "type": "SYMBOL", "name": "_ident_regex" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "sub_identifier" + }, + { + "type": "BLANK" + } + ] } ] }, @@ -247,10 +259,6 @@ ] } }, - "param_value": { - "type": "PATTERN", - "value": "[\\w\\-_]+" - }, "_ident_regex": { "type": "PATTERN", "value": "[\\p{L}0-9\\-_\"' ]+" diff --git a/src/node-types.json b/src/node-types.json index 4ba1fbc..e497ba4 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -21,7 +21,17 @@ { "type": "identifier", "named": true, - "fields": {} + "fields": {}, + "children": { + "multiple": false, + "required": false, + "types": [ + { + "type": "sub_identifier", + "named": true + } + ] + } }, { "type": "shape_label", @@ -62,6 +72,21 @@ ] } }, + { + "type": "sub_identifier", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + } + ] + } + }, { "type": ".", "named": false diff --git a/src/parser.c b/src/parser.c index c2cd77d..0fbb7b5 100644 --- a/src/parser.c +++ b/src/parser.c @@ -6,9 +6,9 @@ #endif #define LANGUAGE_VERSION 14 -#define STATE_COUNT 17 +#define STATE_COUNT 20 #define LARGE_STATE_COUNT 2 -#define SYMBOL_COUNT 22 +#define SYMBOL_COUNT 23 #define ALIAS_COUNT 0 #define TOKEN_COUNT 15 #define EXTERNAL_TOKEN_COUNT 0 @@ -36,8 +36,9 @@ enum { sym_shape_title = 17, sym_shape_label = 18, sym_identifier = 19, - aux_sym_source_file_repeat1 = 20, - aux_sym_shape_title_repeat1 = 21, + sym_sub_identifier = 20, + aux_sym_source_file_repeat1 = 21, + aux_sym_shape_title_repeat1 = 22, }; static const char * const ts_symbol_names[] = { @@ -61,6 +62,7 @@ static const char * const ts_symbol_names[] = { [sym_shape_title] = "shape_title", [sym_shape_label] = "shape_label", [sym_identifier] = "identifier", + [sym_sub_identifier] = "sub_identifier", [aux_sym_source_file_repeat1] = "source_file_repeat1", [aux_sym_shape_title_repeat1] = "shape_title_repeat1", }; @@ -86,6 +88,7 @@ static const TSSymbol ts_symbol_map[] = { [sym_shape_title] = sym_shape_title, [sym_shape_label] = sym_shape_label, [sym_identifier] = sym_identifier, + [sym_sub_identifier] = sym_sub_identifier, [aux_sym_source_file_repeat1] = aux_sym_source_file_repeat1, [aux_sym_shape_title_repeat1] = aux_sym_shape_title_repeat1, }; @@ -171,6 +174,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, + [sym_sub_identifier] = { + .visible = true, + .named = true, + }, [aux_sym_source_file_repeat1] = { .visible = false, .named = false, @@ -207,6 +214,9 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [14] = 14, [15] = 15, [16] = 16, + [17] = 17, + [18] = 18, + [19] = 19, }; static inline bool sym__ident_regex_character_set_1(int32_t c) { @@ -731,9 +741,9 @@ static inline bool sym__ident_regex_character_set_2(int32_t c) { ? (c < 710 ? (c < 'a' ? (c < '0' - ? (c < '"' - ? c == ' ' - : (c <= '"' || c == '\'')) + ? (c < '\'' + ? c == '"' + : (c <= '\'' || c == '-')) : (c <= '9' || (c < '_' ? (c >= 'A' && c <= 'Z') : c <= '_'))) @@ -1240,99 +1250,99 @@ static inline bool sym__ident_regex_character_set_2(int32_t c) { static inline bool sym__ident_regex_character_set_3(int32_t c) { return (c < 6528 ? (c < 2969 - ? (c < 2144 - ? (c < 1015 - ? (c < 248 - ? (c < '_' - ? (c < '-' + ? (c < 2160 + ? (c < 1162 + ? (c < 710 + ? (c < 'a' + ? (c < '0' ? (c < '"' ? c == ' ' : (c <= '"' || c == '\'')) - : (c <= '-' || (c < 'A' - ? (c >= '0' && c <= '9') - : c <= 'Z'))) - : (c <= '_' || (c < 186 - ? (c < 170 - ? (c >= 'a' && c <= 'z') - : (c <= 170 || c == 181)) - : (c <= 186 || (c < 216 - ? (c >= 192 && c <= 214) - : c <= 246))))) - : (c <= 705 || (c < 890 - ? (c < 750 - ? (c < 736 - ? (c >= 710 && c <= 721) - : (c <= 740 || c == 748)) - : (c <= 750 || (c < 886 - ? (c >= 880 && c <= 884) - : c <= 887))) - : (c <= 893 || (c < 908 - ? (c < 902 - ? c == 895 - : (c <= 902 || (c >= 904 && c <= 906))) - : (c <= 908 || (c < 931 - ? (c >= 910 && c <= 929) - : c <= 1013))))))) - : (c <= 1153 || (c < 1791 - ? (c < 1568 - ? (c < 1376 - ? (c < 1329 - ? (c >= 1162 && c <= 1327) - : (c <= 1366 || c == 1369)) - : (c <= 1416 || (c < 1519 - ? (c >= 1488 && c <= 1514) - : c <= 1522))) - : (c <= 1610 || (c < 1765 - ? (c < 1649 - ? (c >= 1646 && c <= 1647) - : (c <= 1747 || c == 1749)) - : (c <= 1766 || (c < 1786 - ? (c >= 1774 && c <= 1775) - : c <= 1788))))) - : (c <= 1791 || (c < 2042 - ? (c < 1969 - ? (c < 1810 - ? c == 1808 - : (c <= 1839 || (c >= 1869 && c <= 1957))) - : (c <= 1969 || (c < 2036 - ? (c >= 1994 && c <= 2026) - : c <= 2037))) - : (c <= 2042 || (c < 2084 - ? (c < 2074 - ? (c >= 2048 && c <= 2069) - : c <= 2074) - : (c <= 2084 || (c < 2112 - ? c == 2088 - : c <= 2136))))))))) - : (c <= 2154 || (c < 2649 - ? (c < 2486 - ? (c < 2392 - ? (c < 2308 - ? (c < 2185 - ? (c >= 2160 && c <= 2183) - : (c <= 2190 || (c >= 2208 && c <= 2249))) - : (c <= 2361 || (c < 2384 - ? c == 2365 - : c <= 2384))) - : (c <= 2401 || (c < 2451 - ? (c < 2437 - ? (c >= 2417 && c <= 2432) - : (c <= 2444 || (c >= 2447 && c <= 2448))) - : (c <= 2472 || (c < 2482 - ? (c >= 2474 && c <= 2480) - : c <= 2482))))) - : (c <= 2489 || (c < 2565 - ? (c < 2527 - ? (c < 2510 - ? c == 2493 - : (c <= 2510 || (c >= 2524 && c <= 2525))) - : (c <= 2529 || (c < 2556 - ? (c >= 2544 && c <= 2545) - : c <= 2556))) - : (c <= 2570 || (c < 2610 - ? (c < 2579 - ? (c >= 2575 && c <= 2576) - : (c <= 2600 || (c >= 2602 && c <= 2608))) + : (c <= '9' || (c < '_' + ? (c >= 'A' && c <= 'Z') + : c <= '_'))) + : (c <= 'z' || (c < 192 + ? (c < 181 + ? c == 170 + : (c <= 181 || c == 186)) + : (c <= 214 || (c < 248 + ? (c >= 216 && c <= 246) + : c <= 705))))) + : (c <= 721 || (c < 895 + ? (c < 880 + ? (c < 748 + ? (c >= 736 && c <= 740) + : (c <= 748 || c == 750)) + : (c <= 884 || (c < 890 + ? (c >= 886 && c <= 887) + : c <= 893))) + : (c <= 895 || (c < 910 + ? (c < 904 + ? c == 902 + : (c <= 906 || c == 908)) + : (c <= 929 || (c < 1015 + ? (c >= 931 && c <= 1013) + : c <= 1153))))))) + : (c <= 1327 || (c < 1808 + ? (c < 1646 + ? (c < 1488 + ? (c < 1369 + ? (c >= 1329 && c <= 1366) + : (c <= 1369 || (c >= 1376 && c <= 1416))) + : (c <= 1514 || (c < 1568 + ? (c >= 1519 && c <= 1522) + : c <= 1610))) + : (c <= 1647 || (c < 1774 + ? (c < 1749 + ? (c >= 1649 && c <= 1747) + : (c <= 1749 || (c >= 1765 && c <= 1766))) + : (c <= 1775 || (c < 1791 + ? (c >= 1786 && c <= 1788) + : c <= 1791))))) + : (c <= 1808 || (c < 2048 + ? (c < 1994 + ? (c < 1869 + ? (c >= 1810 && c <= 1839) + : (c <= 1957 || c == 1969)) + : (c <= 2026 || (c < 2042 + ? (c >= 2036 && c <= 2037) + : c <= 2042))) + : (c <= 2069 || (c < 2088 + ? (c < 2084 + ? c == 2074 + : c <= 2084) + : (c <= 2088 || (c < 2144 + ? (c >= 2112 && c <= 2136) + : c <= 2154))))))))) + : (c <= 2183 || (c < 2649 + ? (c < 2493 + ? (c < 2417 + ? (c < 2365 + ? (c < 2208 + ? (c >= 2185 && c <= 2190) + : (c <= 2249 || (c >= 2308 && c <= 2361))) + : (c <= 2365 || (c < 2392 + ? c == 2384 + : c <= 2401))) + : (c <= 2432 || (c < 2474 + ? (c < 2447 + ? (c >= 2437 && c <= 2444) + : (c <= 2448 || (c >= 2451 && c <= 2472))) + : (c <= 2480 || (c < 2486 + ? c == 2482 + : c <= 2489))))) + : (c <= 2493 || (c < 2575 + ? (c < 2544 + ? (c < 2524 + ? c == 2510 + : (c <= 2525 || (c >= 2527 && c <= 2529))) + : (c <= 2545 || (c < 2565 + ? c == 2556 + : c <= 2570))) + : (c <= 2576 || (c < 2610 + ? (c < 2602 + ? (c >= 2579 && c <= 2600) + : c <= 2608) : (c <= 2611 || (c < 2616 ? (c >= 2613 && c <= 2614) : c <= 2617))))))) @@ -1751,241 +1761,768 @@ static inline bool sym__ident_regex_character_set_3(int32_t c) { : c <= 67883))))))))))))))); } -static bool ts_lex(TSLexer *lexer, TSStateId state) { - START_LEXER(); - eof = lexer->eof(lexer); - switch (state) { - case 0: - if (eof) ADVANCE(26); - if (lookahead == '#') ADVANCE(49); - if (lookahead == '-') ADVANCE(6); - if (lookahead == '.') ADVANCE(41); - if (lookahead == ':') ADVANCE(28); - if (lookahead == ';') ADVANCE(33); - if (lookahead == '<') ADVANCE(5); - if (lookahead == 'd') ADVANCE(13); - if (lookahead == 'l') ADVANCE(8); - if (lookahead == 'r') ADVANCE(14); - if (lookahead == 'u') ADVANCE(19); - if (lookahead == '|') ADVANCE(36); - if (lookahead == '\t' || - lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') SKIP(0) - END_STATE(); - case 1: - if (lookahead == '\n') ADVANCE(34); - if (lookahead == ' ') ADVANCE(45); - if (lookahead == '-') ADVANCE(47); - if (lookahead == ':') ADVANCE(28); - if (lookahead == ';') ADVANCE(33); - if (lookahead == '<') ADVANCE(5); - if (lookahead == '\t' || - lookahead == '\r') SKIP(1) - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(48); - END_STATE(); - case 2: - if (lookahead == '\n') ADVANCE(35); - if (lookahead == ':') ADVANCE(28); - if (lookahead == ';') ADVANCE(33); - if (lookahead == '\t' || - lookahead == '\r' || - lookahead == ' ') SKIP(2) - END_STATE(); - case 3: - if (lookahead == '\n') SKIP(3) - if (lookahead == '|') ADVANCE(37); - if (lookahead == '\t' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(38); - if (lookahead != 0) ADVANCE(40); - END_STATE(); - case 4: - if (lookahead == '\n') SKIP(4) - if (lookahead == '\t' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(39); - if (lookahead != 0) ADVANCE(40); - END_STATE(); - case 5: - if (lookahead == '-') ADVANCE(43); - END_STATE(); - case 6: - if (lookahead == '-') ADVANCE(43); - if (lookahead == '>') ADVANCE(42); - END_STATE(); - case 7: - if (lookahead == 'c') ADVANCE(23); - END_STATE(); - case 8: - if (lookahead == 'e') ADVANCE(10); - END_STATE(); - case 9: - if (lookahead == 'e') ADVANCE(7); - END_STATE(); - case 10: - if (lookahead == 'f') ADVANCE(21); - END_STATE(); - case 11: - if (lookahead == 'g') ADVANCE(12); - END_STATE(); - case 12: - if (lookahead == 'h') ADVANCE(22); - END_STATE(); - case 13: - if (lookahead == 'i') ADVANCE(20); - if (lookahead == 'o') ADVANCE(24); - END_STATE(); - case 14: - if (lookahead == 'i') ADVANCE(11); - END_STATE(); - case 15: - if (lookahead == 'i') ADVANCE(18); - END_STATE(); - case 16: - if (lookahead == 'n') ADVANCE(32); - END_STATE(); - case 17: - if (lookahead == 'n') ADVANCE(27); - END_STATE(); - case 18: - if (lookahead == 'o') ADVANCE(17); - END_STATE(); - case 19: - if (lookahead == 'p') ADVANCE(29); - END_STATE(); - case 20: - if (lookahead == 'r') ADVANCE(9); - END_STATE(); - case 21: - if (lookahead == 't') ADVANCE(31); - END_STATE(); - case 22: - if (lookahead == 't') ADVANCE(30); +static inline bool sym__ident_regex_character_set_4(int32_t c) { + return (c < 6528 + ? (c < 2969 + ? (c < 2144 + ? (c < 1015 + ? (c < 248 + ? (c < '_' + ? (c < '-' + ? (c < '"' + ? c == ' ' + : (c <= '"' || c == '\'')) + : (c <= '-' || (c < 'A' + ? (c >= '0' && c <= '9') + : c <= 'Z'))) + : (c <= '_' || (c < 186 + ? (c < 170 + ? (c >= 'a' && c <= 'z') + : (c <= 170 || c == 181)) + : (c <= 186 || (c < 216 + ? (c >= 192 && c <= 214) + : c <= 246))))) + : (c <= 705 || (c < 890 + ? (c < 750 + ? (c < 736 + ? (c >= 710 && c <= 721) + : (c <= 740 || c == 748)) + : (c <= 750 || (c < 886 + ? (c >= 880 && c <= 884) + : c <= 887))) + : (c <= 893 || (c < 908 + ? (c < 902 + ? c == 895 + : (c <= 902 || (c >= 904 && c <= 906))) + : (c <= 908 || (c < 931 + ? (c >= 910 && c <= 929) + : c <= 1013))))))) + : (c <= 1153 || (c < 1791 + ? (c < 1568 + ? (c < 1376 + ? (c < 1329 + ? (c >= 1162 && c <= 1327) + : (c <= 1366 || c == 1369)) + : (c <= 1416 || (c < 1519 + ? (c >= 1488 && c <= 1514) + : c <= 1522))) + : (c <= 1610 || (c < 1765 + ? (c < 1649 + ? (c >= 1646 && c <= 1647) + : (c <= 1747 || c == 1749)) + : (c <= 1766 || (c < 1786 + ? (c >= 1774 && c <= 1775) + : c <= 1788))))) + : (c <= 1791 || (c < 2042 + ? (c < 1969 + ? (c < 1810 + ? c == 1808 + : (c <= 1839 || (c >= 1869 && c <= 1957))) + : (c <= 1969 || (c < 2036 + ? (c >= 1994 && c <= 2026) + : c <= 2037))) + : (c <= 2042 || (c < 2084 + ? (c < 2074 + ? (c >= 2048 && c <= 2069) + : c <= 2074) + : (c <= 2084 || (c < 2112 + ? c == 2088 + : c <= 2136))))))))) + : (c <= 2154 || (c < 2649 + ? (c < 2486 + ? (c < 2392 + ? (c < 2308 + ? (c < 2185 + ? (c >= 2160 && c <= 2183) + : (c <= 2190 || (c >= 2208 && c <= 2249))) + : (c <= 2361 || (c < 2384 + ? c == 2365 + : c <= 2384))) + : (c <= 2401 || (c < 2451 + ? (c < 2437 + ? (c >= 2417 && c <= 2432) + : (c <= 2444 || (c >= 2447 && c <= 2448))) + : (c <= 2472 || (c < 2482 + ? (c >= 2474 && c <= 2480) + : c <= 2482))))) + : (c <= 2489 || (c < 2565 + ? (c < 2527 + ? (c < 2510 + ? c == 2493 + : (c <= 2510 || (c >= 2524 && c <= 2525))) + : (c <= 2529 || (c < 2556 + ? (c >= 2544 && c <= 2545) + : c <= 2556))) + : (c <= 2570 || (c < 2610 + ? (c < 2579 + ? (c >= 2575 && c <= 2576) + : (c <= 2600 || (c >= 2602 && c <= 2608))) + : (c <= 2611 || (c < 2616 + ? (c >= 2613 && c <= 2614) + : c <= 2617))))))) + : (c <= 2652 || (c < 2831 + ? (c < 2738 + ? (c < 2703 + ? (c < 2674 + ? c == 2654 + : (c <= 2676 || (c >= 2693 && c <= 2701))) + : (c <= 2705 || (c < 2730 + ? (c >= 2707 && c <= 2728) + : c <= 2736))) + : (c <= 2739 || (c < 2784 + ? (c < 2749 + ? (c >= 2741 && c <= 2745) + : (c <= 2749 || c == 2768)) + : (c <= 2785 || (c < 2821 + ? c == 2809 + : c <= 2828))))) + : (c <= 2832 || (c < 2911 + ? (c < 2869 + ? (c < 2858 + ? (c >= 2835 && c <= 2856) + : (c <= 2864 || (c >= 2866 && c <= 2867))) + : (c <= 2873 || (c < 2908 + ? c == 2877 + : c <= 2909))) + : (c <= 2913 || (c < 2949 + ? (c < 2947 + ? c == 2929 + : c <= 2947) + : (c <= 2954 || (c < 2962 + ? (c >= 2958 && c <= 2960) + : c <= 2965))))))))))) + : (c <= 2970 || (c < 3976 + ? (c < 3389 + ? (c < 3168 + ? (c < 3077 + ? (c < 2984 + ? (c < 2974 + ? c == 2972 + : (c <= 2975 || (c >= 2979 && c <= 2980))) + : (c <= 2986 || (c < 3024 + ? (c >= 2990 && c <= 3001) + : c <= 3024))) + : (c <= 3084 || (c < 3133 + ? (c < 3090 + ? (c >= 3086 && c <= 3088) + : (c <= 3112 || (c >= 3114 && c <= 3129))) + : (c <= 3133 || (c < 3165 + ? (c >= 3160 && c <= 3162) + : c <= 3165))))) + : (c <= 3169 || (c < 3261 + ? (c < 3218 + ? (c < 3205 + ? c == 3200 + : (c <= 3212 || (c >= 3214 && c <= 3216))) + : (c <= 3240 || (c < 3253 + ? (c >= 3242 && c <= 3251) + : c <= 3257))) + : (c <= 3261 || (c < 3332 + ? (c < 3296 + ? (c >= 3293 && c <= 3294) + : (c <= 3297 || (c >= 3313 && c <= 3314))) + : (c <= 3340 || (c < 3346 + ? (c >= 3342 && c <= 3344) + : c <= 3386))))))) + : (c <= 3389 || (c < 3716 + ? (c < 3507 + ? (c < 3450 + ? (c < 3412 + ? c == 3406 + : (c <= 3414 || (c >= 3423 && c <= 3425))) + : (c <= 3455 || (c < 3482 + ? (c >= 3461 && c <= 3478) + : c <= 3505))) + : (c <= 3515 || (c < 3634 + ? (c < 3520 + ? c == 3517 + : (c <= 3526 || (c >= 3585 && c <= 3632))) + : (c <= 3635 || (c < 3713 + ? (c >= 3648 && c <= 3654) + : c <= 3714))))) + : (c <= 3716 || (c < 3776 + ? (c < 3751 + ? (c < 3724 + ? (c >= 3718 && c <= 3722) + : (c <= 3747 || c == 3749)) + : (c <= 3760 || (c < 3773 + ? (c >= 3762 && c <= 3763) + : c <= 3773))) + : (c <= 3780 || (c < 3840 + ? (c < 3804 + ? c == 3782 + : c <= 3807) + : (c <= 3840 || (c < 3913 + ? (c >= 3904 && c <= 3911) + : c <= 3948))))))))) + : (c <= 3980 || (c < 4824 + ? (c < 4348 + ? (c < 4206 + ? (c < 4186 + ? (c < 4159 + ? (c >= 4096 && c <= 4138) + : (c <= 4159 || (c >= 4176 && c <= 4181))) + : (c <= 4189 || (c < 4197 + ? c == 4193 + : c <= 4198))) + : (c <= 4208 || (c < 4295 + ? (c < 4238 + ? (c >= 4213 && c <= 4225) + : (c <= 4238 || (c >= 4256 && c <= 4293))) + : (c <= 4295 || (c < 4304 + ? c == 4301 + : c <= 4346))))) + : (c <= 4680 || (c < 4752 + ? (c < 4698 + ? (c < 4688 + ? (c >= 4682 && c <= 4685) + : (c <= 4694 || c == 4696)) + : (c <= 4701 || (c < 4746 + ? (c >= 4704 && c <= 4744) + : c <= 4749))) + : (c <= 4784 || (c < 4800 + ? (c < 4792 + ? (c >= 4786 && c <= 4789) + : c <= 4798) + : (c <= 4800 || (c < 4808 + ? (c >= 4802 && c <= 4805) + : c <= 4822))))))) + : (c <= 4880 || (c < 5984 + ? (c < 5743 + ? (c < 5024 + ? (c < 4888 + ? (c >= 4882 && c <= 4885) + : (c <= 4954 || (c >= 4992 && c <= 5007))) + : (c <= 5109 || (c < 5121 + ? (c >= 5112 && c <= 5117) + : c <= 5740))) + : (c <= 5759 || (c < 5888 + ? (c < 5792 + ? (c >= 5761 && c <= 5786) + : (c <= 5866 || (c >= 5873 && c <= 5880))) + : (c <= 5905 || (c < 5952 + ? (c >= 5919 && c <= 5937) + : c <= 5969))))) + : (c <= 5996 || (c < 6279 + ? (c < 6108 + ? (c < 6016 + ? (c >= 5998 && c <= 6000) + : (c <= 6067 || c == 6103)) + : (c <= 6108 || (c < 6272 + ? (c >= 6176 && c <= 6264) + : c <= 6276))) + : (c <= 6312 || (c < 6400 + ? (c < 6320 + ? c == 6314 + : c <= 6389) + : (c <= 6430 || (c < 6512 + ? (c >= 6480 && c <= 6509) + : c <= 6516))))))))))))) + : (c <= 6571 || (c < 43250 + ? (c < 8526 + ? (c < 8029 + ? (c < 7312 + ? (c < 7043 + ? (c < 6823 + ? (c < 6656 + ? (c >= 6576 && c <= 6601) + : (c <= 6678 || (c >= 6688 && c <= 6740))) + : (c <= 6823 || (c < 6981 + ? (c >= 6917 && c <= 6963) + : c <= 6988))) + : (c <= 7072 || (c < 7245 + ? (c < 7098 + ? (c >= 7086 && c <= 7087) + : (c <= 7141 || (c >= 7168 && c <= 7203))) + : (c <= 7247 || (c < 7296 + ? (c >= 7258 && c <= 7293) + : c <= 7304))))) + : (c <= 7354 || (c < 7680 + ? (c < 7413 + ? (c < 7401 + ? (c >= 7357 && c <= 7359) + : (c <= 7404 || (c >= 7406 && c <= 7411))) + : (c <= 7414 || (c < 7424 + ? c == 7418 + : c <= 7615))) + : (c <= 7957 || (c < 8016 + ? (c < 7968 + ? (c >= 7960 && c <= 7965) + : (c <= 8005 || (c >= 8008 && c <= 8013))) + : (c <= 8023 || (c < 8027 + ? c == 8025 + : c <= 8027))))))) + : (c <= 8029 || (c < 8336 + ? (c < 8144 + ? (c < 8126 + ? (c < 8064 + ? (c >= 8031 && c <= 8061) + : (c <= 8116 || (c >= 8118 && c <= 8124))) + : (c <= 8126 || (c < 8134 + ? (c >= 8130 && c <= 8132) + : c <= 8140))) + : (c <= 8147 || (c < 8182 + ? (c < 8160 + ? (c >= 8150 && c <= 8155) + : (c <= 8172 || (c >= 8178 && c <= 8180))) + : (c <= 8188 || (c < 8319 + ? c == 8305 + : c <= 8319))))) + : (c <= 8348 || (c < 8486 + ? (c < 8469 + ? (c < 8455 + ? c == 8450 + : (c <= 8455 || (c >= 8458 && c <= 8467))) + : (c <= 8469 || (c < 8484 + ? (c >= 8473 && c <= 8477) + : c <= 8484))) + : (c <= 8486 || (c < 8495 + ? (c < 8490 + ? c == 8488 + : c <= 8493) + : (c <= 8505 || (c < 8517 + ? (c >= 8508 && c <= 8511) + : c <= 8521))))))))) + : (c <= 8526 || (c < 12549 + ? (c < 11704 + ? (c < 11565 + ? (c < 11506 + ? (c < 11264 + ? (c >= 8579 && c <= 8580) + : (c <= 11492 || (c >= 11499 && c <= 11502))) + : (c <= 11507 || (c < 11559 + ? (c >= 11520 && c <= 11557) + : c <= 11559))) + : (c <= 11565 || (c < 11680 + ? (c < 11631 + ? (c >= 11568 && c <= 11623) + : (c <= 11631 || (c >= 11648 && c <= 11670))) + : (c <= 11686 || (c < 11696 + ? (c >= 11688 && c <= 11694) + : c <= 11702))))) + : (c <= 11710 || (c < 12337 + ? (c < 11736 + ? (c < 11720 + ? (c >= 11712 && c <= 11718) + : (c <= 11726 || (c >= 11728 && c <= 11734))) + : (c <= 11742 || (c < 12293 + ? c == 11823 + : c <= 12294))) + : (c <= 12341 || (c < 12445 + ? (c < 12353 + ? (c >= 12347 && c <= 12348) + : c <= 12438) + : (c <= 12447 || (c < 12540 + ? (c >= 12449 && c <= 12538) + : c <= 12543))))))) + : (c <= 12591 || (c < 42656 + ? (c < 40959 + ? (c < 13312 + ? (c < 12704 + ? (c >= 12593 && c <= 12686) + : (c <= 12735 || (c >= 12784 && c <= 12799))) + : (c <= 13312 || (c < 19968 + ? c == 19903 + : c <= 19968))) + : (c <= 42124 || (c < 42538 + ? (c < 42240 + ? (c >= 42192 && c <= 42237) + : (c <= 42508 || (c >= 42512 && c <= 42527))) + : (c <= 42539 || (c < 42623 + ? (c >= 42560 && c <= 42606) + : c <= 42653))))) + : (c <= 42725 || (c < 42994 + ? (c < 42960 + ? (c < 42786 + ? (c >= 42775 && c <= 42783) + : (c <= 42888 || (c >= 42891 && c <= 42954))) + : (c <= 42961 || (c < 42965 + ? c == 42963 + : c <= 42969))) + : (c <= 43009 || (c < 43020 + ? (c < 43015 + ? (c >= 43011 && c <= 43013) + : c <= 43018) + : (c <= 43042 || (c < 43138 + ? (c >= 43072 && c <= 43123) + : c <= 43187))))))))))) + : (c <= 43255 || (c < 65313 + ? (c < 43808 + ? (c < 43616 + ? (c < 43471 + ? (c < 43312 + ? (c < 43261 + ? c == 43259 + : (c <= 43262 || (c >= 43274 && c <= 43301))) + : (c <= 43334 || (c < 43396 + ? (c >= 43360 && c <= 43388) + : c <= 43442))) + : (c <= 43471 || (c < 43520 + ? (c < 43494 + ? (c >= 43488 && c <= 43492) + : (c <= 43503 || (c >= 43514 && c <= 43518))) + : (c <= 43560 || (c < 43588 + ? (c >= 43584 && c <= 43586) + : c <= 43595))))) + : (c <= 43638 || (c < 43714 + ? (c < 43701 + ? (c < 43646 + ? c == 43642 + : (c <= 43695 || c == 43697)) + : (c <= 43702 || (c < 43712 + ? (c >= 43705 && c <= 43709) + : c <= 43712))) + : (c <= 43714 || (c < 43777 + ? (c < 43744 + ? (c >= 43739 && c <= 43741) + : (c <= 43754 || (c >= 43762 && c <= 43764))) + : (c <= 43782 || (c < 43793 + ? (c >= 43785 && c <= 43790) + : c <= 43798))))))) + : (c <= 43814 || (c < 64287 + ? (c < 55216 + ? (c < 43888 + ? (c < 43824 + ? (c >= 43816 && c <= 43822) + : (c <= 43866 || (c >= 43868 && c <= 43881))) + : (c <= 44002 || (c < 55203 + ? c == 44032 + : c <= 55203))) + : (c <= 55238 || (c < 64256 + ? (c < 63744 + ? (c >= 55243 && c <= 55291) + : (c <= 64109 || (c >= 64112 && c <= 64217))) + : (c <= 64262 || (c < 64285 + ? (c >= 64275 && c <= 64279) + : c <= 64285))))) + : (c <= 64296 || (c < 64467 + ? (c < 64320 + ? (c < 64312 + ? (c >= 64298 && c <= 64310) + : (c <= 64316 || c == 64318)) + : (c <= 64321 || (c < 64326 + ? (c >= 64323 && c <= 64324) + : c <= 64433))) + : (c <= 64829 || (c < 65008 + ? (c < 64914 + ? (c >= 64848 && c <= 64911) + : c <= 64967) + : (c <= 65019 || (c < 65142 + ? (c >= 65136 && c <= 65140) + : c <= 65276))))))))) + : (c <= 65338 || (c < 66864 + ? (c < 66176 + ? (c < 65536 + ? (c < 65482 + ? (c < 65382 + ? (c >= 65345 && c <= 65370) + : (c <= 65470 || (c >= 65474 && c <= 65479))) + : (c <= 65487 || (c < 65498 + ? (c >= 65490 && c <= 65495) + : c <= 65500))) + : (c <= 65547 || (c < 65599 + ? (c < 65576 + ? (c >= 65549 && c <= 65574) + : (c <= 65594 || (c >= 65596 && c <= 65597))) + : (c <= 65613 || (c < 65664 + ? (c >= 65616 && c <= 65629) + : c <= 65786))))) + : (c <= 66204 || (c < 66464 + ? (c < 66370 + ? (c < 66304 + ? (c >= 66208 && c <= 66256) + : (c <= 66335 || (c >= 66349 && c <= 66368))) + : (c <= 66377 || (c < 66432 + ? (c >= 66384 && c <= 66421) + : c <= 66461))) + : (c <= 66499 || (c < 66736 + ? (c < 66560 + ? (c >= 66504 && c <= 66511) + : c <= 66717) + : (c <= 66771 || (c < 66816 + ? (c >= 66776 && c <= 66811) + : c <= 66855))))))) + : (c <= 66915 || (c < 67506 + ? (c < 66995 + ? (c < 66964 + ? (c < 66940 + ? (c >= 66928 && c <= 66938) + : (c <= 66954 || (c >= 66956 && c <= 66962))) + : (c <= 66965 || (c < 66979 + ? (c >= 66967 && c <= 66977) + : c <= 66993))) + : (c <= 67001 || (c < 67424 + ? (c < 67072 + ? (c >= 67003 && c <= 67004) + : (c <= 67382 || (c >= 67392 && c <= 67413))) + : (c <= 67431 || (c < 67463 + ? (c >= 67456 && c <= 67461) + : c <= 67504))))) + : (c <= 67514 || (c < 67680 + ? (c < 67639 + ? (c < 67592 + ? (c >= 67584 && c <= 67589) + : (c <= 67592 || (c >= 67594 && c <= 67637))) + : (c <= 67640 || (c < 67647 + ? c == 67644 + : c <= 67669))) + : (c <= 67702 || (c < 67828 + ? (c < 67808 + ? (c >= 67712 && c <= 67742) + : c <= 67826) + : (c <= 67829 || (c < 67872 + ? (c >= 67840 && c <= 67861) + : c <= 67883))))))))))))))); +} + +static bool ts_lex(TSLexer *lexer, TSStateId state) { + START_LEXER(); + eof = lexer->eof(lexer); + switch (state) { + case 0: + if (eof) ADVANCE(27); + if (lookahead == '#') ADVANCE(51); + if (lookahead == '-') ADVANCE(7); + if (lookahead == '.') ADVANCE(42); + if (lookahead == ':') ADVANCE(29); + if (lookahead == ';') ADVANCE(34); + if (lookahead == '<') ADVANCE(6); + if (lookahead == 'd') ADVANCE(14); + if (lookahead == 'l') ADVANCE(9); + if (lookahead == 'r') ADVANCE(15); + if (lookahead == 'u') ADVANCE(20); + if (lookahead == '|') ADVANCE(37); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') SKIP(0) + END_STATE(); + case 1: + if (lookahead == '\n') ADVANCE(35); + if (lookahead == ' ') ADVANCE(46); + if (lookahead == '-') ADVANCE(49); + if (lookahead == '.') ADVANCE(42); + if (lookahead == ':') ADVANCE(29); + if (lookahead == ';') ADVANCE(34); + if (lookahead == '<') ADVANCE(6); + if (lookahead == '\t' || + lookahead == '\r') SKIP(1) + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(50); + END_STATE(); + case 2: + if (lookahead == '\n') ADVANCE(36); + if (lookahead == ':') ADVANCE(29); + if (lookahead == ';') ADVANCE(34); + if (lookahead == '\t' || + lookahead == '\r' || + lookahead == ' ') SKIP(2) + END_STATE(); + case 3: + if (lookahead == '\n') SKIP(3) + if (lookahead == '|') ADVANCE(38); + if (lookahead == '\t' || + lookahead == '\r' || + lookahead == ' ') ADVANCE(39); + if (lookahead != 0) ADVANCE(41); + END_STATE(); + case 4: + if (lookahead == '\n') SKIP(4) + if (lookahead == '\t' || + lookahead == '\r' || + lookahead == ' ') ADVANCE(40); + if (lookahead != 0) ADVANCE(41); + END_STATE(); + case 5: + if (lookahead == ' ') ADVANCE(48); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r') SKIP(5) + if (sym__ident_regex_character_set_2(lookahead)) ADVANCE(50); + END_STATE(); + case 6: + if (lookahead == '-') ADVANCE(44); + END_STATE(); + case 7: + if (lookahead == '-') ADVANCE(44); + if (lookahead == '>') ADVANCE(43); + END_STATE(); + case 8: + if (lookahead == 'c') ADVANCE(24); + END_STATE(); + case 9: + if (lookahead == 'e') ADVANCE(11); + END_STATE(); + case 10: + if (lookahead == 'e') ADVANCE(8); + END_STATE(); + case 11: + if (lookahead == 'f') ADVANCE(22); + END_STATE(); + case 12: + if (lookahead == 'g') ADVANCE(13); + END_STATE(); + case 13: + if (lookahead == 'h') ADVANCE(23); + END_STATE(); + case 14: + if (lookahead == 'i') ADVANCE(21); + if (lookahead == 'o') ADVANCE(25); + END_STATE(); + case 15: + if (lookahead == 'i') ADVANCE(12); + END_STATE(); + case 16: + if (lookahead == 'i') ADVANCE(19); + END_STATE(); + case 17: + if (lookahead == 'n') ADVANCE(33); + END_STATE(); + case 18: + if (lookahead == 'n') ADVANCE(28); + END_STATE(); + case 19: + if (lookahead == 'o') ADVANCE(18); + END_STATE(); + case 20: + if (lookahead == 'p') ADVANCE(30); + END_STATE(); + case 21: + if (lookahead == 'r') ADVANCE(10); + END_STATE(); + case 22: + if (lookahead == 't') ADVANCE(32); END_STATE(); case 23: - if (lookahead == 't') ADVANCE(15); + if (lookahead == 't') ADVANCE(31); END_STATE(); case 24: - if (lookahead == 'w') ADVANCE(16); + if (lookahead == 't') ADVANCE(16); END_STATE(); case 25: - if (eof) ADVANCE(26); - if (lookahead == ' ') ADVANCE(46); - if (lookahead == '-') ADVANCE(47); - if (lookahead == '<') ADVANCE(5); - if (lookahead == '\t' || - lookahead == '\n' || - lookahead == '\r') SKIP(25) - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(48); + if (lookahead == 'w') ADVANCE(17); END_STATE(); case 26: - ACCEPT_TOKEN(ts_builtin_sym_end); + if (eof) ADVANCE(27); + if (lookahead == ' ') ADVANCE(47); + if (lookahead == '-') ADVANCE(49); + if (lookahead == '<') ADVANCE(6); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r') SKIP(26) + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(50); END_STATE(); case 27: - ACCEPT_TOKEN(anon_sym_direction); + ACCEPT_TOKEN(ts_builtin_sym_end); END_STATE(); case 28: - ACCEPT_TOKEN(anon_sym_COLON); + ACCEPT_TOKEN(anon_sym_direction); END_STATE(); case 29: - ACCEPT_TOKEN(anon_sym_up); + ACCEPT_TOKEN(anon_sym_COLON); END_STATE(); case 30: - ACCEPT_TOKEN(anon_sym_right); + ACCEPT_TOKEN(anon_sym_up); END_STATE(); case 31: - ACCEPT_TOKEN(anon_sym_left); + ACCEPT_TOKEN(anon_sym_right); END_STATE(); case 32: - ACCEPT_TOKEN(anon_sym_down); + ACCEPT_TOKEN(anon_sym_left); END_STATE(); case 33: - ACCEPT_TOKEN(anon_sym_SEMI); + ACCEPT_TOKEN(anon_sym_down); END_STATE(); case 34: - ACCEPT_TOKEN(aux_sym_expression_token1); - if (lookahead == '\n') ADVANCE(34); - if (lookahead == ' ') ADVANCE(45); + ACCEPT_TOKEN(anon_sym_SEMI); END_STATE(); case 35: ACCEPT_TOKEN(aux_sym_expression_token1); if (lookahead == '\n') ADVANCE(35); + if (lookahead == ' ') ADVANCE(46); END_STATE(); case 36: - ACCEPT_TOKEN(anon_sym_PIPE); + ACCEPT_TOKEN(aux_sym_expression_token1); + if (lookahead == '\n') ADVANCE(36); END_STATE(); case 37: ACCEPT_TOKEN(anon_sym_PIPE); - if (lookahead != 0 && - lookahead != '\n') ADVANCE(40); END_STATE(); case 38: - ACCEPT_TOKEN(aux_sym_shape_label_token1); - if (lookahead == '|') ADVANCE(37); - if (lookahead == '\t' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(38); + ACCEPT_TOKEN(anon_sym_PIPE); if (lookahead != 0 && - lookahead != '\n') ADVANCE(40); + lookahead != '\n') ADVANCE(41); END_STATE(); case 39: ACCEPT_TOKEN(aux_sym_shape_label_token1); + if (lookahead == '|') ADVANCE(38); if (lookahead == '\t' || lookahead == '\r' || lookahead == ' ') ADVANCE(39); if (lookahead != 0 && - lookahead != '\n') ADVANCE(40); + lookahead != '\n') ADVANCE(41); END_STATE(); case 40: ACCEPT_TOKEN(aux_sym_shape_label_token1); + if (lookahead == '\t' || + lookahead == '\r' || + lookahead == ' ') ADVANCE(40); if (lookahead != 0 && - lookahead != '\n') ADVANCE(40); + lookahead != '\n') ADVANCE(41); END_STATE(); case 41: - ACCEPT_TOKEN(anon_sym_DOT); + ACCEPT_TOKEN(aux_sym_shape_label_token1); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(41); END_STATE(); case 42: - ACCEPT_TOKEN(sym_connection); + ACCEPT_TOKEN(anon_sym_DOT); END_STATE(); case 43: ACCEPT_TOKEN(sym_connection); - if (lookahead == '-') ADVANCE(43); - if (lookahead == '>') ADVANCE(42); END_STATE(); case 44: ACCEPT_TOKEN(sym_connection); if (lookahead == '-') ADVANCE(44); - if (lookahead == '>') ADVANCE(42); - if (sym__ident_regex_character_set_2(lookahead)) ADVANCE(48); + if (lookahead == '>') ADVANCE(43); END_STATE(); case 45: - ACCEPT_TOKEN(sym__ident_regex); - if (lookahead == '\n') ADVANCE(34); - if (lookahead == ' ') ADVANCE(45); - if (lookahead == '-') ADVANCE(47); - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(48); + ACCEPT_TOKEN(sym_connection); + if (lookahead == '-') ADVANCE(45); + if (lookahead == '>') ADVANCE(43); + if (sym__ident_regex_character_set_3(lookahead)) ADVANCE(50); END_STATE(); case 46: ACCEPT_TOKEN(sym__ident_regex); + if (lookahead == '\n') ADVANCE(35); if (lookahead == ' ') ADVANCE(46); - if (lookahead == '-') ADVANCE(47); - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(48); + if (lookahead == '-') ADVANCE(49); + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(50); END_STATE(); case 47: ACCEPT_TOKEN(sym__ident_regex); - if (lookahead == '-') ADVANCE(44); - if (lookahead == '>') ADVANCE(42); - if (sym__ident_regex_character_set_2(lookahead)) ADVANCE(48); + if (lookahead == ' ') ADVANCE(47); + if (lookahead == '-') ADVANCE(49); + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(50); END_STATE(); case 48: ACCEPT_TOKEN(sym__ident_regex); - if (sym__ident_regex_character_set_3(lookahead)) ADVANCE(48); + if (lookahead == ' ') ADVANCE(48); + if (sym__ident_regex_character_set_2(lookahead)) ADVANCE(50); END_STATE(); case 49: + ACCEPT_TOKEN(sym__ident_regex); + if (lookahead == '-') ADVANCE(45); + if (lookahead == '>') ADVANCE(43); + if (sym__ident_regex_character_set_3(lookahead)) ADVANCE(50); + END_STATE(); + case 50: + ACCEPT_TOKEN(sym__ident_regex); + if (sym__ident_regex_character_set_4(lookahead)) ADVANCE(50); + END_STATE(); + case 51: ACCEPT_TOKEN(sym__comment); if (lookahead != 0 && - lookahead != '\n') ADVANCE(49); + lookahead != '\n') ADVANCE(51); END_STATE(); default: return false; @@ -1994,22 +2531,25 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { static const TSLexMode ts_lex_modes[STATE_COUNT] = { [0] = {.lex_state = 0}, - [1] = {.lex_state = 25}, - [2] = {.lex_state = 25}, - [3] = {.lex_state = 25}, + [1] = {.lex_state = 26}, + [2] = {.lex_state = 26}, + [3] = {.lex_state = 26}, [4] = {.lex_state = 1}, [5] = {.lex_state = 1}, [6] = {.lex_state = 1}, - [7] = {.lex_state = 2}, - [8] = {.lex_state = 25}, - [9] = {.lex_state = 25}, - [10] = {.lex_state = 3}, - [11] = {.lex_state = 2}, - [12] = {.lex_state = 2}, - [13] = {.lex_state = 2}, - [14] = {.lex_state = 0}, - [15] = {.lex_state = 4}, - [16] = {.lex_state = 0}, + [7] = {.lex_state = 1}, + [8] = {.lex_state = 1}, + [9] = {.lex_state = 2}, + [10] = {.lex_state = 26}, + [11] = {.lex_state = 26}, + [12] = {.lex_state = 5}, + [13] = {.lex_state = 3}, + [14] = {.lex_state = 2}, + [15] = {.lex_state = 2}, + [16] = {.lex_state = 2}, + [17] = {.lex_state = 0}, + [18] = {.lex_state = 4}, + [19] = {.lex_state = 0}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { @@ -2028,12 +2568,12 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [sym__comment] = ACTIONS(1), }, [1] = { - [sym_source_file] = STATE(14), + [sym_source_file] = STATE(17), [sym_expression] = STATE(2), - [sym_shape_title] = STATE(7), - [sym_identifier] = STATE(4), + [sym_shape_title] = STATE(9), + [sym_identifier] = STATE(5), [aux_sym_source_file_repeat1] = STATE(2), - [aux_sym_shape_title_repeat1] = STATE(4), + [aux_sym_shape_title_repeat1] = STATE(5), [ts_builtin_sym_end] = ACTIONS(3), [sym_connection] = ACTIONS(5), [sym__ident_regex] = ACTIONS(7), @@ -2048,12 +2588,12 @@ static const uint16_t ts_small_parse_table[] = { sym__ident_regex, ACTIONS(9), 1, ts_builtin_sym_end, - STATE(7), 1, + STATE(9), 1, sym_shape_title, STATE(3), 2, sym_expression, aux_sym_source_file_repeat1, - STATE(4), 2, + STATE(5), 2, sym_identifier, aux_sym_shape_title_repeat1, [21] = 6, @@ -2063,94 +2603,117 @@ static const uint16_t ts_small_parse_table[] = { sym_connection, ACTIONS(16), 1, sym__ident_regex, - STATE(7), 1, + STATE(9), 1, sym_shape_title, STATE(3), 2, sym_expression, aux_sym_source_file_repeat1, - STATE(4), 2, + STATE(5), 2, sym_identifier, aux_sym_shape_title_repeat1, - [42] = 4, + [42] = 3, + ACTIONS(21), 1, + anon_sym_DOT, + STATE(7), 1, + sym_sub_identifier, + ACTIONS(19), 5, + anon_sym_COLON, + anon_sym_SEMI, + aux_sym_expression_token1, + sym_connection, + sym__ident_regex, + [56] = 4, ACTIONS(7), 1, sym__ident_regex, - ACTIONS(21), 1, + ACTIONS(25), 1, sym_connection, - STATE(5), 2, + STATE(6), 2, sym_identifier, aux_sym_shape_title_repeat1, - ACTIONS(19), 3, + ACTIONS(23), 3, anon_sym_COLON, anon_sym_SEMI, aux_sym_expression_token1, - [58] = 4, - ACTIONS(25), 1, + [72] = 4, + ACTIONS(29), 1, sym_connection, - ACTIONS(28), 1, + ACTIONS(32), 1, sym__ident_regex, - STATE(5), 2, + STATE(6), 2, sym_identifier, aux_sym_shape_title_repeat1, - ACTIONS(23), 3, + ACTIONS(27), 3, anon_sym_COLON, anon_sym_SEMI, aux_sym_expression_token1, - [74] = 1, - ACTIONS(31), 5, + [88] = 1, + ACTIONS(35), 5, anon_sym_COLON, anon_sym_SEMI, aux_sym_expression_token1, sym_connection, sym__ident_regex, - [82] = 4, - ACTIONS(33), 1, + [96] = 1, + ACTIONS(37), 5, anon_sym_COLON, - ACTIONS(35), 1, anon_sym_SEMI, - ACTIONS(37), 1, aux_sym_expression_token1, - STATE(11), 1, - sym_shape_label, - [95] = 2, - ACTIONS(39), 1, - ts_builtin_sym_end, - ACTIONS(41), 2, sym_connection, sym__ident_regex, - [103] = 2, + [104] = 4, + ACTIONS(39), 1, + anon_sym_COLON, + ACTIONS(41), 1, + anon_sym_SEMI, ACTIONS(43), 1, + aux_sym_expression_token1, + STATE(14), 1, + sym_shape_label, + [117] = 2, + ACTIONS(45), 1, ts_builtin_sym_end, - ACTIONS(45), 2, + ACTIONS(47), 2, sym_connection, sym__ident_regex, - [111] = 2, - ACTIONS(47), 1, - anon_sym_PIPE, + [125] = 2, ACTIONS(49), 1, - aux_sym_shape_label_token1, - [118] = 2, - ACTIONS(51), 1, - anon_sym_SEMI, + ts_builtin_sym_end, + ACTIONS(51), 2, + sym_connection, + sym__ident_regex, + [133] = 2, ACTIONS(53), 1, - aux_sym_expression_token1, - [125] = 2, + sym__ident_regex, + STATE(8), 1, + sym_identifier, + [140] = 2, ACTIONS(55), 1, - anon_sym_SEMI, + anon_sym_PIPE, ACTIONS(57), 1, - aux_sym_expression_token1, - [132] = 2, + aux_sym_shape_label_token1, + [147] = 2, ACTIONS(59), 1, anon_sym_SEMI, ACTIONS(61), 1, aux_sym_expression_token1, - [139] = 1, + [154] = 2, ACTIONS(63), 1, - ts_builtin_sym_end, - [143] = 1, + anon_sym_SEMI, ACTIONS(65), 1, - aux_sym_shape_label_token1, - [147] = 1, + aux_sym_expression_token1, + [161] = 2, ACTIONS(67), 1, + anon_sym_SEMI, + ACTIONS(69), 1, + aux_sym_expression_token1, + [168] = 1, + ACTIONS(71), 1, + ts_builtin_sym_end, + [172] = 1, + ACTIONS(73), 1, + aux_sym_shape_label_token1, + [176] = 1, + ACTIONS(75), 1, anon_sym_PIPE, }; @@ -2158,54 +2721,61 @@ static const uint32_t ts_small_parse_table_map[] = { [SMALL_STATE(2)] = 0, [SMALL_STATE(3)] = 21, [SMALL_STATE(4)] = 42, - [SMALL_STATE(5)] = 58, - [SMALL_STATE(6)] = 74, - [SMALL_STATE(7)] = 82, - [SMALL_STATE(8)] = 95, - [SMALL_STATE(9)] = 103, - [SMALL_STATE(10)] = 111, - [SMALL_STATE(11)] = 118, - [SMALL_STATE(12)] = 125, - [SMALL_STATE(13)] = 132, - [SMALL_STATE(14)] = 139, - [SMALL_STATE(15)] = 143, - [SMALL_STATE(16)] = 147, + [SMALL_STATE(5)] = 56, + [SMALL_STATE(6)] = 72, + [SMALL_STATE(7)] = 88, + [SMALL_STATE(8)] = 96, + [SMALL_STATE(9)] = 104, + [SMALL_STATE(10)] = 117, + [SMALL_STATE(11)] = 125, + [SMALL_STATE(12)] = 133, + [SMALL_STATE(13)] = 140, + [SMALL_STATE(14)] = 147, + [SMALL_STATE(15)] = 154, + [SMALL_STATE(16)] = 161, + [SMALL_STATE(17)] = 168, + [SMALL_STATE(18)] = 172, + [SMALL_STATE(19)] = 176, }; 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_source_file, 0), - [5] = {.entry = {.count = 1, .reusable = false}}, SHIFT(4), - [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(6), + [5] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5), + [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(4), [9] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), [11] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), - [13] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(4), - [16] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(6), - [19] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_shape_title, 1), - [21] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5), - [23] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_shape_title_repeat1, 2), - [25] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_shape_title_repeat1, 2), SHIFT_REPEAT(5), - [28] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_shape_title_repeat1, 2), SHIFT_REPEAT(6), - [31] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_identifier, 1), - [33] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10), - [35] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), - [37] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), - [39] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 2), - [41] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 2), - [43] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 3), - [45] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 3), - [47] = {.entry = {.count = 1, .reusable = false}}, SHIFT(15), - [49] = {.entry = {.count = 1, .reusable = false}}, SHIFT(12), - [51] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9), - [53] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), - [55] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_shape_label, 2), - [57] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_shape_label, 2), - [59] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_shape_label, 4), - [61] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_shape_label, 4), - [63] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), - [65] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), - [67] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), + [13] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(5), + [16] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(4), + [19] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_identifier, 1), + [21] = {.entry = {.count = 1, .reusable = false}}, SHIFT(12), + [23] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_shape_title, 1), + [25] = {.entry = {.count = 1, .reusable = false}}, SHIFT(6), + [27] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_shape_title_repeat1, 2), + [29] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_shape_title_repeat1, 2), SHIFT_REPEAT(6), + [32] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_shape_title_repeat1, 2), SHIFT_REPEAT(4), + [35] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_identifier, 2), + [37] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sub_identifier, 2), + [39] = {.entry = {.count = 1, .reusable = false}}, SHIFT(13), + [41] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10), + [43] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), + [45] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 2), + [47] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 2), + [49] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 3), + [51] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 3), + [53] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), + [55] = {.entry = {.count = 1, .reusable = false}}, SHIFT(18), + [57] = {.entry = {.count = 1, .reusable = false}}, SHIFT(15), + [59] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11), + [61] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [63] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_shape_label, 2), + [65] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_shape_label, 2), + [67] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_shape_label, 4), + [69] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_shape_label, 4), + [71] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [73] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), + [75] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), }; #ifdef __cplusplus diff --git a/test/corpus/labels.txt b/test/corpus/labels.txt new file mode 100644 index 0000000..996b2dc --- /dev/null +++ b/test/corpus/labels.txt @@ -0,0 +1,18 @@ +================== +Simple Labels +================== + +pg: PostgreSQL +Cloud: my cloud + +--- + +(source_file + (expression + (shape_title + (identifier)) + (shape_label)) + (expression + (shape_title + (identifier)) + (shape_label))) \ No newline at end of file diff --git a/test/corpus/shapes.txt b/test/corpus/shapes.txt index 55418b8..a86684d 100644 --- a/test/corpus/shapes.txt +++ b/test/corpus/shapes.txt @@ -75,5 +75,4 @@ SQLite; Cassandra (identifier))) (expression (shape_title - (identifier)))) - + (identifier)))) \ No newline at end of file From 21cebfca8e827e61b5e1a7d1d938d15afc8e8b2f Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 2 Jul 2023 23:07:59 +0300 Subject: [PATCH 02/11] update tests to match simpler grammar] --- grammar.js | 30 +++++++++++++++--------------- test/corpus/connections.txt | 27 +++++++++------------------ test/corpus/labels.txt | 10 ++++------ test/corpus/shapes.txt | 33 +++++++++++---------------------- 4 files changed, 39 insertions(+), 61 deletions(-) diff --git a/grammar.js b/grammar.js index 12d062f..e6c8499 100644 --- a/grammar.js +++ b/grammar.js @@ -1,3 +1,8 @@ +const PREC = { + connection: 100, + identifier: 50, +} + module.exports = grammar({ name: 'd2', @@ -20,17 +25,15 @@ module.exports = grammar({ )), expression: $ => seq( - $.shape_title, - optional($.shape_label), + repeat1(choice( + $.identifier, + $.connection, + )), + optional($.label), choice(";", /\n+/), ), - shape_title: $ => prec.right(repeat1(choice( - $.connection, - $.identifier, - ))), - - shape_label: _ => seq(":", choice( + label: _ => seq(":", choice( seq("|", /.+/, "|"), /.+/, )), @@ -56,19 +59,16 @@ module.exports = grammar({ // building blocks - identifier: $ => seq( - $._ident_regex, - optional($.sub_identifier), - ), + identifier: $ => prec.left(repeat1(seq($._ident_regex, optional($.sub_identifier)))), sub_identifier: $ => seq(".", $.identifier), - connection: _ => token(choice( + connection: _ => prec(PREC.connection, token(choice( seq("-", repeat1("-")), seq("<", repeat1("-")), seq(repeat1("-"), ">"), seq("<", repeat1("-"), ">"), - )), + ))), // param_value: _ => /[\w\-_]+/i, @@ -76,7 +76,7 @@ module.exports = grammar({ _ident_regex: _ => /[\p{L}0-9\-_"' ]+/, - _comment: _ => token(seq('#', /.*/)), + _comment: _ => token(seq('#', /.*/, /\n/)), } }); diff --git a/test/corpus/connections.txt b/test/corpus/connections.txt index 4c07e2d..390b0b1 100644 --- a/test/corpus/connections.txt +++ b/test/corpus/connections.txt @@ -11,17 +11,13 @@ Isolated valid connections (source_file (expression - (shape_title - (connection))) + (connection)) (expression - (shape_title - (connection))) + (connection)) (expression - (shape_title - (connection))) + (connection)) (expression - (shape_title - (connection)))) + (connection))) ==================||| Isolated long connections @@ -36,17 +32,13 @@ Isolated long connections (source_file (expression - (shape_title - (connection))) + (connection)) (expression - (shape_title - (connection))) + (connection)) (expression - (shape_title - (connection))) + (connection)) (expression - (shape_title - (connection)))) + (connection))) ==================||| Invalid connections @@ -61,7 +53,6 @@ Invalid connections (source_file (expression - (shape_title - (identifier))) + (identifier)) (ERROR (UNEXPECTED '>'))) diff --git a/test/corpus/labels.txt b/test/corpus/labels.txt index 996b2dc..4e6d451 100644 --- a/test/corpus/labels.txt +++ b/test/corpus/labels.txt @@ -9,10 +9,8 @@ Cloud: my cloud (source_file (expression - (shape_title - (identifier)) - (shape_label)) + (identifier) + (label)) (expression - (shape_title - (identifier)) - (shape_label))) \ No newline at end of file + (identifier) + (label))) \ No newline at end of file diff --git a/test/corpus/shapes.txt b/test/corpus/shapes.txt index a86684d..f39e0d2 100644 --- a/test/corpus/shapes.txt +++ b/test/corpus/shapes.txt @@ -8,8 +8,7 @@ x (source_file (expression - (shape_title - (identifier)))) + (identifier))) ================== Multiple Shapes @@ -23,14 +22,11 @@ xy (source_file (expression - (shape_title - (identifier))) + (identifier)) (expression - (shape_title - (identifier))) + (identifier)) (expression - (shape_title - (identifier)))) + (identifier))) ================== Special characters in name @@ -46,20 +42,15 @@ a-shape (source_file (expression - (shape_title - (identifier))) + (identifier)) (expression - (shape_title - (identifier))) + (identifier)) (expression - (shape_title - (identifier))) + (identifier)) (expression - (shape_title - (identifier))) + (identifier)) (expression - (shape_title - (identifier)))) + (identifier))) ================== Semicolon delimiter @@ -71,8 +62,6 @@ SQLite; Cassandra (source_file (expression - (shape_title - (identifier))) + (identifier)) (expression - (shape_title - (identifier)))) \ No newline at end of file + (identifier))) \ No newline at end of file From 74f2d71a67a022b67ea4dbd057354915b5b3ca12 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 2 Jul 2023 23:52:52 +0300 Subject: [PATCH 03/11] add complex containers grammar --- grammar.js | 35 +- src/grammar.json | 177 +--- src/node-types.json | 48 +- src/parser.c | 1780 ++++++++--------------------------- test/corpus/connections.txt | 39 +- test/corpus/containers.txt | 52 + 6 files changed, 568 insertions(+), 1563 deletions(-) create mode 100644 test/corpus/containers.txt diff --git a/grammar.js b/grammar.js index e6c8499..e3b5a84 100644 --- a/grammar.js +++ b/grammar.js @@ -1,8 +1,3 @@ -const PREC = { - connection: 100, - identifier: 50, -} - module.exports = grammar({ name: 'd2', @@ -12,10 +7,7 @@ module.exports = grammar({ $.expression, )), - extras: $ => choice( - $._comment, - /\s+/, - ), + extras: $ => choice($._comment, /\s+/), direction: _ => seq("direction", ":", choice( "up", @@ -34,7 +26,7 @@ module.exports = grammar({ ), label: _ => seq(":", choice( - seq("|", /.+/, "|"), + // seq("|", /.+/, "|"), /.+/, )), @@ -59,22 +51,29 @@ module.exports = grammar({ // building blocks - identifier: $ => prec.left(repeat1(seq($._ident_regex, optional($.sub_identifier)))), + identifier: $ => prec.right(repeat1( + choice( + $._ident_regex, + $.sub_identifier, + "-", + ) + )), sub_identifier: $ => seq(".", $.identifier), - connection: _ => prec(PREC.connection, token(choice( - seq("-", repeat1("-")), - seq("<", repeat1("-")), - seq(repeat1("-"), ">"), - seq("<", repeat1("-"), ">"), - ))), + // Trust me it's better that way than doing it via seq's/repeat's + connection: _ => choice( + /--+/, + /<-+/, + /-+>/, + /<-+>/, + ), // param_value: _ => /[\w\-_]+/i, // const-like rules - _ident_regex: _ => /[\p{L}0-9\-_"' ]+/, + _ident_regex: _ => /[\p{L}0-9_"' ]+/, _comment: _ => token(seq('#', /.*/, /\n/)), } diff --git a/src/grammar.json b/src/grammar.json index f57271e..4e860c4 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -64,15 +64,27 @@ "type": "SEQ", "members": [ { - "type": "SYMBOL", - "name": "shape_title" + "type": "REPEAT1", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "identifier" + }, + { + "type": "SYMBOL", + "name": "connection" + } + ] + } }, { "type": "CHOICE", "members": [ { "type": "SYMBOL", - "name": "shape_label" + "name": "label" }, { "type": "BLANK" @@ -94,27 +106,7 @@ } ] }, - "shape_title": { - "type": "PREC_RIGHT", - "value": 0, - "content": { - "type": "REPEAT1", - "content": { - "type": "CHOICE", - "members": [ - { - "type": "SYMBOL", - "name": "connection" - }, - { - "type": "SYMBOL", - "name": "identifier" - } - ] - } - } - }, - "shape_label": { + "label": { "type": "SEQ", "members": [ { @@ -124,23 +116,6 @@ { "type": "CHOICE", "members": [ - { - "type": "SEQ", - "members": [ - { - "type": "STRING", - "value": "|" - }, - { - "type": "PATTERN", - "value": ".+" - }, - { - "type": "STRING", - "value": "|" - } - ] - }, { "type": "PATTERN", "value": ".+" @@ -150,25 +125,28 @@ ] }, "identifier": { - "type": "SEQ", - "members": [ - { - "type": "SYMBOL", - "name": "_ident_regex" - }, - { + "type": "PREC_RIGHT", + "value": 0, + "content": { + "type": "REPEAT1", + "content": { "type": "CHOICE", "members": [ + { + "type": "SYMBOL", + "name": "_ident_regex" + }, { "type": "SYMBOL", "name": "sub_identifier" }, { - "type": "BLANK" + "type": "STRING", + "value": "-" } ] } - ] + } }, "sub_identifier": { "type": "SEQ", @@ -184,84 +162,29 @@ ] }, "connection": { - "type": "TOKEN", - "content": { - "type": "CHOICE", - "members": [ - { - "type": "SEQ", - "members": [ - { - "type": "STRING", - "value": "-" - }, - { - "type": "REPEAT1", - "content": { - "type": "STRING", - "value": "-" - } - } - ] - }, - { - "type": "SEQ", - "members": [ - { - "type": "STRING", - "value": "<" - }, - { - "type": "REPEAT1", - "content": { - "type": "STRING", - "value": "-" - } - } - ] - }, - { - "type": "SEQ", - "members": [ - { - "type": "REPEAT1", - "content": { - "type": "STRING", - "value": "-" - } - }, - { - "type": "STRING", - "value": ">" - } - ] - }, - { - "type": "SEQ", - "members": [ - { - "type": "STRING", - "value": "<" - }, - { - "type": "REPEAT1", - "content": { - "type": "STRING", - "value": "-" - } - }, - { - "type": "STRING", - "value": ">" - } - ] - } - ] - } + "type": "CHOICE", + "members": [ + { + "type": "PATTERN", + "value": "--+" + }, + { + "type": "PATTERN", + "value": "<-+" + }, + { + "type": "PATTERN", + "value": "-+>" + }, + { + "type": "PATTERN", + "value": "<-+>" + } + ] }, "_ident_regex": { "type": "PATTERN", - "value": "[\\p{L}0-9\\-_\"' ]+" + "value": "[\\p{L}0-9_\"' ]+" }, "_comment": { "type": "TOKEN", @@ -275,6 +198,10 @@ { "type": "PATTERN", "value": ".*" + }, + { + "type": "PATTERN", + "value": "\\n" } ] } diff --git a/src/node-types.json b/src/node-types.json index e497ba4..1d802c7 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -1,4 +1,9 @@ [ + { + "type": "connection", + "named": true, + "fields": {} + }, { "type": "expression", "named": true, @@ -8,11 +13,15 @@ "required": true, "types": [ { - "type": "shape_label", + "type": "connection", + "named": true + }, + { + "type": "identifier", "named": true }, { - "type": "shape_title", + "type": "label", "named": true } ] @@ -23,7 +32,7 @@ "named": true, "fields": {}, "children": { - "multiple": false, + "multiple": true, "required": false, "types": [ { @@ -34,29 +43,10 @@ } }, { - "type": "shape_label", + "type": "label", "named": true, "fields": {} }, - { - "type": "shape_title", - "named": true, - "fields": {}, - "children": { - "multiple": true, - "required": true, - "types": [ - { - "type": "connection", - "named": true - }, - { - "type": "identifier", - "named": true - } - ] - } - }, { "type": "source_file", "named": true, @@ -87,6 +77,10 @@ ] } }, + { + "type": "-", + "named": false + }, { "type": ".", "named": false @@ -99,10 +93,6 @@ "type": ";", "named": false }, - { - "type": "connection", - "named": true - }, { "type": "direction", "named": false @@ -122,9 +112,5 @@ { "type": "up", "named": false - }, - { - "type": "|", - "named": false } ] \ No newline at end of file diff --git a/src/parser.c b/src/parser.c index 0fbb7b5..5e58e59 100644 --- a/src/parser.c +++ b/src/parser.c @@ -6,14 +6,14 @@ #endif #define LANGUAGE_VERSION 14 -#define STATE_COUNT 20 -#define LARGE_STATE_COUNT 2 -#define SYMBOL_COUNT 23 +#define STATE_COUNT 17 +#define LARGE_STATE_COUNT 6 +#define SYMBOL_COUNT 27 #define ALIAS_COUNT 0 -#define TOKEN_COUNT 15 +#define TOKEN_COUNT 18 #define EXTERNAL_TOKEN_COUNT 0 #define FIELD_COUNT 0 -#define MAX_ALIAS_SEQUENCE_LENGTH 4 +#define MAX_ALIAS_SEQUENCE_LENGTH 3 #define PRODUCTION_ID_COUNT 1 enum { @@ -25,20 +25,24 @@ enum { anon_sym_down = 6, anon_sym_SEMI = 7, aux_sym_expression_token1 = 8, - anon_sym_PIPE = 9, - aux_sym_shape_label_token1 = 10, + aux_sym_label_token1 = 9, + anon_sym_DASH = 10, anon_sym_DOT = 11, - sym_connection = 12, - sym__ident_regex = 13, - sym__comment = 14, - sym_source_file = 15, - sym_expression = 16, - sym_shape_title = 17, - sym_shape_label = 18, - sym_identifier = 19, - sym_sub_identifier = 20, - aux_sym_source_file_repeat1 = 21, - aux_sym_shape_title_repeat1 = 22, + aux_sym_connection_token1 = 12, + aux_sym_connection_token2 = 13, + aux_sym_connection_token3 = 14, + aux_sym_connection_token4 = 15, + sym__ident_regex = 16, + sym__comment = 17, + sym_source_file = 18, + sym_expression = 19, + sym_label = 20, + sym_identifier = 21, + sym_sub_identifier = 22, + sym_connection = 23, + aux_sym_source_file_repeat1 = 24, + aux_sym_expression_repeat1 = 25, + aux_sym_identifier_repeat1 = 26, }; static const char * const ts_symbol_names[] = { @@ -51,20 +55,24 @@ static const char * const ts_symbol_names[] = { [anon_sym_down] = "down", [anon_sym_SEMI] = ";", [aux_sym_expression_token1] = "expression_token1", - [anon_sym_PIPE] = "|", - [aux_sym_shape_label_token1] = "shape_label_token1", + [aux_sym_label_token1] = "label_token1", + [anon_sym_DASH] = "-", [anon_sym_DOT] = ".", - [sym_connection] = "connection", + [aux_sym_connection_token1] = "connection_token1", + [aux_sym_connection_token2] = "connection_token2", + [aux_sym_connection_token3] = "connection_token3", + [aux_sym_connection_token4] = "connection_token4", [sym__ident_regex] = "_ident_regex", [sym__comment] = "_comment", [sym_source_file] = "source_file", [sym_expression] = "expression", - [sym_shape_title] = "shape_title", - [sym_shape_label] = "shape_label", + [sym_label] = "label", [sym_identifier] = "identifier", [sym_sub_identifier] = "sub_identifier", + [sym_connection] = "connection", [aux_sym_source_file_repeat1] = "source_file_repeat1", - [aux_sym_shape_title_repeat1] = "shape_title_repeat1", + [aux_sym_expression_repeat1] = "expression_repeat1", + [aux_sym_identifier_repeat1] = "identifier_repeat1", }; static const TSSymbol ts_symbol_map[] = { @@ -77,20 +85,24 @@ static const TSSymbol ts_symbol_map[] = { [anon_sym_down] = anon_sym_down, [anon_sym_SEMI] = anon_sym_SEMI, [aux_sym_expression_token1] = aux_sym_expression_token1, - [anon_sym_PIPE] = anon_sym_PIPE, - [aux_sym_shape_label_token1] = aux_sym_shape_label_token1, + [aux_sym_label_token1] = aux_sym_label_token1, + [anon_sym_DASH] = anon_sym_DASH, [anon_sym_DOT] = anon_sym_DOT, - [sym_connection] = sym_connection, + [aux_sym_connection_token1] = aux_sym_connection_token1, + [aux_sym_connection_token2] = aux_sym_connection_token2, + [aux_sym_connection_token3] = aux_sym_connection_token3, + [aux_sym_connection_token4] = aux_sym_connection_token4, [sym__ident_regex] = sym__ident_regex, [sym__comment] = sym__comment, [sym_source_file] = sym_source_file, [sym_expression] = sym_expression, - [sym_shape_title] = sym_shape_title, - [sym_shape_label] = sym_shape_label, + [sym_label] = sym_label, [sym_identifier] = sym_identifier, [sym_sub_identifier] = sym_sub_identifier, + [sym_connection] = sym_connection, [aux_sym_source_file_repeat1] = aux_sym_source_file_repeat1, - [aux_sym_shape_title_repeat1] = aux_sym_shape_title_repeat1, + [aux_sym_expression_repeat1] = aux_sym_expression_repeat1, + [aux_sym_identifier_repeat1] = aux_sym_identifier_repeat1, }; static const TSSymbolMetadata ts_symbol_metadata[] = { @@ -130,21 +142,33 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = false, .named = false, }, - [anon_sym_PIPE] = { - .visible = true, + [aux_sym_label_token1] = { + .visible = false, .named = false, }, - [aux_sym_shape_label_token1] = { - .visible = false, + [anon_sym_DASH] = { + .visible = true, .named = false, }, [anon_sym_DOT] = { .visible = true, .named = false, }, - [sym_connection] = { - .visible = true, - .named = true, + [aux_sym_connection_token1] = { + .visible = false, + .named = false, + }, + [aux_sym_connection_token2] = { + .visible = false, + .named = false, + }, + [aux_sym_connection_token3] = { + .visible = false, + .named = false, + }, + [aux_sym_connection_token4] = { + .visible = false, + .named = false, }, [sym__ident_regex] = { .visible = false, @@ -162,19 +186,19 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, - [sym_shape_title] = { + [sym_label] = { .visible = true, .named = true, }, - [sym_shape_label] = { + [sym_identifier] = { .visible = true, .named = true, }, - [sym_identifier] = { + [sym_sub_identifier] = { .visible = true, .named = true, }, - [sym_sub_identifier] = { + [sym_connection] = { .visible = true, .named = true, }, @@ -182,7 +206,11 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = false, .named = false, }, - [aux_sym_shape_title_repeat1] = { + [aux_sym_expression_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_identifier_repeat1] = { .visible = false, .named = false, }, @@ -214,9 +242,6 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [14] = 14, [15] = 15, [16] = 16, - [17] = 17, - [18] = 18, - [19] = 19, }; static inline bool sym__ident_regex_character_set_1(int32_t c) { @@ -741,9 +766,9 @@ static inline bool sym__ident_regex_character_set_2(int32_t c) { ? (c < 710 ? (c < 'a' ? (c < '0' - ? (c < '\'' - ? c == '"' - : (c <= '\'' || c == '-')) + ? (c < '"' + ? c == ' ' + : (c <= '"' || c == '\'')) : (c <= '9' || (c < '_' ? (c >= 'A' && c <= 'Z') : c <= '_'))) @@ -1247,1282 +1272,225 @@ static inline bool sym__ident_regex_character_set_2(int32_t c) { : c <= 67883))))))))))))))); } -static inline bool sym__ident_regex_character_set_3(int32_t c) { - return (c < 6528 - ? (c < 2969 - ? (c < 2160 - ? (c < 1162 - ? (c < 710 - ? (c < 'a' - ? (c < '0' - ? (c < '"' - ? c == ' ' - : (c <= '"' || c == '\'')) - : (c <= '9' || (c < '_' - ? (c >= 'A' && c <= 'Z') - : c <= '_'))) - : (c <= 'z' || (c < 192 - ? (c < 181 - ? c == 170 - : (c <= 181 || c == 186)) - : (c <= 214 || (c < 248 - ? (c >= 216 && c <= 246) - : c <= 705))))) - : (c <= 721 || (c < 895 - ? (c < 880 - ? (c < 748 - ? (c >= 736 && c <= 740) - : (c <= 748 || c == 750)) - : (c <= 884 || (c < 890 - ? (c >= 886 && c <= 887) - : c <= 893))) - : (c <= 895 || (c < 910 - ? (c < 904 - ? c == 902 - : (c <= 906 || c == 908)) - : (c <= 929 || (c < 1015 - ? (c >= 931 && c <= 1013) - : c <= 1153))))))) - : (c <= 1327 || (c < 1808 - ? (c < 1646 - ? (c < 1488 - ? (c < 1369 - ? (c >= 1329 && c <= 1366) - : (c <= 1369 || (c >= 1376 && c <= 1416))) - : (c <= 1514 || (c < 1568 - ? (c >= 1519 && c <= 1522) - : c <= 1610))) - : (c <= 1647 || (c < 1774 - ? (c < 1749 - ? (c >= 1649 && c <= 1747) - : (c <= 1749 || (c >= 1765 && c <= 1766))) - : (c <= 1775 || (c < 1791 - ? (c >= 1786 && c <= 1788) - : c <= 1791))))) - : (c <= 1808 || (c < 2048 - ? (c < 1994 - ? (c < 1869 - ? (c >= 1810 && c <= 1839) - : (c <= 1957 || c == 1969)) - : (c <= 2026 || (c < 2042 - ? (c >= 2036 && c <= 2037) - : c <= 2042))) - : (c <= 2069 || (c < 2088 - ? (c < 2084 - ? c == 2074 - : c <= 2084) - : (c <= 2088 || (c < 2144 - ? (c >= 2112 && c <= 2136) - : c <= 2154))))))))) - : (c <= 2183 || (c < 2649 - ? (c < 2493 - ? (c < 2417 - ? (c < 2365 - ? (c < 2208 - ? (c >= 2185 && c <= 2190) - : (c <= 2249 || (c >= 2308 && c <= 2361))) - : (c <= 2365 || (c < 2392 - ? c == 2384 - : c <= 2401))) - : (c <= 2432 || (c < 2474 - ? (c < 2447 - ? (c >= 2437 && c <= 2444) - : (c <= 2448 || (c >= 2451 && c <= 2472))) - : (c <= 2480 || (c < 2486 - ? c == 2482 - : c <= 2489))))) - : (c <= 2493 || (c < 2575 - ? (c < 2544 - ? (c < 2524 - ? c == 2510 - : (c <= 2525 || (c >= 2527 && c <= 2529))) - : (c <= 2545 || (c < 2565 - ? c == 2556 - : c <= 2570))) - : (c <= 2576 || (c < 2610 - ? (c < 2602 - ? (c >= 2579 && c <= 2600) - : c <= 2608) - : (c <= 2611 || (c < 2616 - ? (c >= 2613 && c <= 2614) - : c <= 2617))))))) - : (c <= 2652 || (c < 2831 - ? (c < 2738 - ? (c < 2703 - ? (c < 2674 - ? c == 2654 - : (c <= 2676 || (c >= 2693 && c <= 2701))) - : (c <= 2705 || (c < 2730 - ? (c >= 2707 && c <= 2728) - : c <= 2736))) - : (c <= 2739 || (c < 2784 - ? (c < 2749 - ? (c >= 2741 && c <= 2745) - : (c <= 2749 || c == 2768)) - : (c <= 2785 || (c < 2821 - ? c == 2809 - : c <= 2828))))) - : (c <= 2832 || (c < 2911 - ? (c < 2869 - ? (c < 2858 - ? (c >= 2835 && c <= 2856) - : (c <= 2864 || (c >= 2866 && c <= 2867))) - : (c <= 2873 || (c < 2908 - ? c == 2877 - : c <= 2909))) - : (c <= 2913 || (c < 2949 - ? (c < 2947 - ? c == 2929 - : c <= 2947) - : (c <= 2954 || (c < 2962 - ? (c >= 2958 && c <= 2960) - : c <= 2965))))))))))) - : (c <= 2970 || (c < 3976 - ? (c < 3389 - ? (c < 3168 - ? (c < 3077 - ? (c < 2984 - ? (c < 2974 - ? c == 2972 - : (c <= 2975 || (c >= 2979 && c <= 2980))) - : (c <= 2986 || (c < 3024 - ? (c >= 2990 && c <= 3001) - : c <= 3024))) - : (c <= 3084 || (c < 3133 - ? (c < 3090 - ? (c >= 3086 && c <= 3088) - : (c <= 3112 || (c >= 3114 && c <= 3129))) - : (c <= 3133 || (c < 3165 - ? (c >= 3160 && c <= 3162) - : c <= 3165))))) - : (c <= 3169 || (c < 3261 - ? (c < 3218 - ? (c < 3205 - ? c == 3200 - : (c <= 3212 || (c >= 3214 && c <= 3216))) - : (c <= 3240 || (c < 3253 - ? (c >= 3242 && c <= 3251) - : c <= 3257))) - : (c <= 3261 || (c < 3332 - ? (c < 3296 - ? (c >= 3293 && c <= 3294) - : (c <= 3297 || (c >= 3313 && c <= 3314))) - : (c <= 3340 || (c < 3346 - ? (c >= 3342 && c <= 3344) - : c <= 3386))))))) - : (c <= 3389 || (c < 3716 - ? (c < 3507 - ? (c < 3450 - ? (c < 3412 - ? c == 3406 - : (c <= 3414 || (c >= 3423 && c <= 3425))) - : (c <= 3455 || (c < 3482 - ? (c >= 3461 && c <= 3478) - : c <= 3505))) - : (c <= 3515 || (c < 3634 - ? (c < 3520 - ? c == 3517 - : (c <= 3526 || (c >= 3585 && c <= 3632))) - : (c <= 3635 || (c < 3713 - ? (c >= 3648 && c <= 3654) - : c <= 3714))))) - : (c <= 3716 || (c < 3776 - ? (c < 3751 - ? (c < 3724 - ? (c >= 3718 && c <= 3722) - : (c <= 3747 || c == 3749)) - : (c <= 3760 || (c < 3773 - ? (c >= 3762 && c <= 3763) - : c <= 3773))) - : (c <= 3780 || (c < 3840 - ? (c < 3804 - ? c == 3782 - : c <= 3807) - : (c <= 3840 || (c < 3913 - ? (c >= 3904 && c <= 3911) - : c <= 3948))))))))) - : (c <= 3980 || (c < 4824 - ? (c < 4348 - ? (c < 4206 - ? (c < 4186 - ? (c < 4159 - ? (c >= 4096 && c <= 4138) - : (c <= 4159 || (c >= 4176 && c <= 4181))) - : (c <= 4189 || (c < 4197 - ? c == 4193 - : c <= 4198))) - : (c <= 4208 || (c < 4295 - ? (c < 4238 - ? (c >= 4213 && c <= 4225) - : (c <= 4238 || (c >= 4256 && c <= 4293))) - : (c <= 4295 || (c < 4304 - ? c == 4301 - : c <= 4346))))) - : (c <= 4680 || (c < 4752 - ? (c < 4698 - ? (c < 4688 - ? (c >= 4682 && c <= 4685) - : (c <= 4694 || c == 4696)) - : (c <= 4701 || (c < 4746 - ? (c >= 4704 && c <= 4744) - : c <= 4749))) - : (c <= 4784 || (c < 4800 - ? (c < 4792 - ? (c >= 4786 && c <= 4789) - : c <= 4798) - : (c <= 4800 || (c < 4808 - ? (c >= 4802 && c <= 4805) - : c <= 4822))))))) - : (c <= 4880 || (c < 5984 - ? (c < 5743 - ? (c < 5024 - ? (c < 4888 - ? (c >= 4882 && c <= 4885) - : (c <= 4954 || (c >= 4992 && c <= 5007))) - : (c <= 5109 || (c < 5121 - ? (c >= 5112 && c <= 5117) - : c <= 5740))) - : (c <= 5759 || (c < 5888 - ? (c < 5792 - ? (c >= 5761 && c <= 5786) - : (c <= 5866 || (c >= 5873 && c <= 5880))) - : (c <= 5905 || (c < 5952 - ? (c >= 5919 && c <= 5937) - : c <= 5969))))) - : (c <= 5996 || (c < 6279 - ? (c < 6108 - ? (c < 6016 - ? (c >= 5998 && c <= 6000) - : (c <= 6067 || c == 6103)) - : (c <= 6108 || (c < 6272 - ? (c >= 6176 && c <= 6264) - : c <= 6276))) - : (c <= 6312 || (c < 6400 - ? (c < 6320 - ? c == 6314 - : c <= 6389) - : (c <= 6430 || (c < 6512 - ? (c >= 6480 && c <= 6509) - : c <= 6516))))))))))))) - : (c <= 6571 || (c < 43250 - ? (c < 8526 - ? (c < 8029 - ? (c < 7312 - ? (c < 7043 - ? (c < 6823 - ? (c < 6656 - ? (c >= 6576 && c <= 6601) - : (c <= 6678 || (c >= 6688 && c <= 6740))) - : (c <= 6823 || (c < 6981 - ? (c >= 6917 && c <= 6963) - : c <= 6988))) - : (c <= 7072 || (c < 7245 - ? (c < 7098 - ? (c >= 7086 && c <= 7087) - : (c <= 7141 || (c >= 7168 && c <= 7203))) - : (c <= 7247 || (c < 7296 - ? (c >= 7258 && c <= 7293) - : c <= 7304))))) - : (c <= 7354 || (c < 7680 - ? (c < 7413 - ? (c < 7401 - ? (c >= 7357 && c <= 7359) - : (c <= 7404 || (c >= 7406 && c <= 7411))) - : (c <= 7414 || (c < 7424 - ? c == 7418 - : c <= 7615))) - : (c <= 7957 || (c < 8016 - ? (c < 7968 - ? (c >= 7960 && c <= 7965) - : (c <= 8005 || (c >= 8008 && c <= 8013))) - : (c <= 8023 || (c < 8027 - ? c == 8025 - : c <= 8027))))))) - : (c <= 8029 || (c < 8336 - ? (c < 8144 - ? (c < 8126 - ? (c < 8064 - ? (c >= 8031 && c <= 8061) - : (c <= 8116 || (c >= 8118 && c <= 8124))) - : (c <= 8126 || (c < 8134 - ? (c >= 8130 && c <= 8132) - : c <= 8140))) - : (c <= 8147 || (c < 8182 - ? (c < 8160 - ? (c >= 8150 && c <= 8155) - : (c <= 8172 || (c >= 8178 && c <= 8180))) - : (c <= 8188 || (c < 8319 - ? c == 8305 - : c <= 8319))))) - : (c <= 8348 || (c < 8486 - ? (c < 8469 - ? (c < 8455 - ? c == 8450 - : (c <= 8455 || (c >= 8458 && c <= 8467))) - : (c <= 8469 || (c < 8484 - ? (c >= 8473 && c <= 8477) - : c <= 8484))) - : (c <= 8486 || (c < 8495 - ? (c < 8490 - ? c == 8488 - : c <= 8493) - : (c <= 8505 || (c < 8517 - ? (c >= 8508 && c <= 8511) - : c <= 8521))))))))) - : (c <= 8526 || (c < 12549 - ? (c < 11704 - ? (c < 11565 - ? (c < 11506 - ? (c < 11264 - ? (c >= 8579 && c <= 8580) - : (c <= 11492 || (c >= 11499 && c <= 11502))) - : (c <= 11507 || (c < 11559 - ? (c >= 11520 && c <= 11557) - : c <= 11559))) - : (c <= 11565 || (c < 11680 - ? (c < 11631 - ? (c >= 11568 && c <= 11623) - : (c <= 11631 || (c >= 11648 && c <= 11670))) - : (c <= 11686 || (c < 11696 - ? (c >= 11688 && c <= 11694) - : c <= 11702))))) - : (c <= 11710 || (c < 12337 - ? (c < 11736 - ? (c < 11720 - ? (c >= 11712 && c <= 11718) - : (c <= 11726 || (c >= 11728 && c <= 11734))) - : (c <= 11742 || (c < 12293 - ? c == 11823 - : c <= 12294))) - : (c <= 12341 || (c < 12445 - ? (c < 12353 - ? (c >= 12347 && c <= 12348) - : c <= 12438) - : (c <= 12447 || (c < 12540 - ? (c >= 12449 && c <= 12538) - : c <= 12543))))))) - : (c <= 12591 || (c < 42656 - ? (c < 40959 - ? (c < 13312 - ? (c < 12704 - ? (c >= 12593 && c <= 12686) - : (c <= 12735 || (c >= 12784 && c <= 12799))) - : (c <= 13312 || (c < 19968 - ? c == 19903 - : c <= 19968))) - : (c <= 42124 || (c < 42538 - ? (c < 42240 - ? (c >= 42192 && c <= 42237) - : (c <= 42508 || (c >= 42512 && c <= 42527))) - : (c <= 42539 || (c < 42623 - ? (c >= 42560 && c <= 42606) - : c <= 42653))))) - : (c <= 42725 || (c < 42994 - ? (c < 42960 - ? (c < 42786 - ? (c >= 42775 && c <= 42783) - : (c <= 42888 || (c >= 42891 && c <= 42954))) - : (c <= 42961 || (c < 42965 - ? c == 42963 - : c <= 42969))) - : (c <= 43009 || (c < 43020 - ? (c < 43015 - ? (c >= 43011 && c <= 43013) - : c <= 43018) - : (c <= 43042 || (c < 43138 - ? (c >= 43072 && c <= 43123) - : c <= 43187))))))))))) - : (c <= 43255 || (c < 65313 - ? (c < 43808 - ? (c < 43616 - ? (c < 43471 - ? (c < 43312 - ? (c < 43261 - ? c == 43259 - : (c <= 43262 || (c >= 43274 && c <= 43301))) - : (c <= 43334 || (c < 43396 - ? (c >= 43360 && c <= 43388) - : c <= 43442))) - : (c <= 43471 || (c < 43520 - ? (c < 43494 - ? (c >= 43488 && c <= 43492) - : (c <= 43503 || (c >= 43514 && c <= 43518))) - : (c <= 43560 || (c < 43588 - ? (c >= 43584 && c <= 43586) - : c <= 43595))))) - : (c <= 43638 || (c < 43714 - ? (c < 43701 - ? (c < 43646 - ? c == 43642 - : (c <= 43695 || c == 43697)) - : (c <= 43702 || (c < 43712 - ? (c >= 43705 && c <= 43709) - : c <= 43712))) - : (c <= 43714 || (c < 43777 - ? (c < 43744 - ? (c >= 43739 && c <= 43741) - : (c <= 43754 || (c >= 43762 && c <= 43764))) - : (c <= 43782 || (c < 43793 - ? (c >= 43785 && c <= 43790) - : c <= 43798))))))) - : (c <= 43814 || (c < 64287 - ? (c < 55216 - ? (c < 43888 - ? (c < 43824 - ? (c >= 43816 && c <= 43822) - : (c <= 43866 || (c >= 43868 && c <= 43881))) - : (c <= 44002 || (c < 55203 - ? c == 44032 - : c <= 55203))) - : (c <= 55238 || (c < 64256 - ? (c < 63744 - ? (c >= 55243 && c <= 55291) - : (c <= 64109 || (c >= 64112 && c <= 64217))) - : (c <= 64262 || (c < 64285 - ? (c >= 64275 && c <= 64279) - : c <= 64285))))) - : (c <= 64296 || (c < 64467 - ? (c < 64320 - ? (c < 64312 - ? (c >= 64298 && c <= 64310) - : (c <= 64316 || c == 64318)) - : (c <= 64321 || (c < 64326 - ? (c >= 64323 && c <= 64324) - : c <= 64433))) - : (c <= 64829 || (c < 65008 - ? (c < 64914 - ? (c >= 64848 && c <= 64911) - : c <= 64967) - : (c <= 65019 || (c < 65142 - ? (c >= 65136 && c <= 65140) - : c <= 65276))))))))) - : (c <= 65338 || (c < 66864 - ? (c < 66176 - ? (c < 65536 - ? (c < 65482 - ? (c < 65382 - ? (c >= 65345 && c <= 65370) - : (c <= 65470 || (c >= 65474 && c <= 65479))) - : (c <= 65487 || (c < 65498 - ? (c >= 65490 && c <= 65495) - : c <= 65500))) - : (c <= 65547 || (c < 65599 - ? (c < 65576 - ? (c >= 65549 && c <= 65574) - : (c <= 65594 || (c >= 65596 && c <= 65597))) - : (c <= 65613 || (c < 65664 - ? (c >= 65616 && c <= 65629) - : c <= 65786))))) - : (c <= 66204 || (c < 66464 - ? (c < 66370 - ? (c < 66304 - ? (c >= 66208 && c <= 66256) - : (c <= 66335 || (c >= 66349 && c <= 66368))) - : (c <= 66377 || (c < 66432 - ? (c >= 66384 && c <= 66421) - : c <= 66461))) - : (c <= 66499 || (c < 66736 - ? (c < 66560 - ? (c >= 66504 && c <= 66511) - : c <= 66717) - : (c <= 66771 || (c < 66816 - ? (c >= 66776 && c <= 66811) - : c <= 66855))))))) - : (c <= 66915 || (c < 67506 - ? (c < 66995 - ? (c < 66964 - ? (c < 66940 - ? (c >= 66928 && c <= 66938) - : (c <= 66954 || (c >= 66956 && c <= 66962))) - : (c <= 66965 || (c < 66979 - ? (c >= 66967 && c <= 66977) - : c <= 66993))) - : (c <= 67001 || (c < 67424 - ? (c < 67072 - ? (c >= 67003 && c <= 67004) - : (c <= 67382 || (c >= 67392 && c <= 67413))) - : (c <= 67431 || (c < 67463 - ? (c >= 67456 && c <= 67461) - : c <= 67504))))) - : (c <= 67514 || (c < 67680 - ? (c < 67639 - ? (c < 67592 - ? (c >= 67584 && c <= 67589) - : (c <= 67592 || (c >= 67594 && c <= 67637))) - : (c <= 67640 || (c < 67647 - ? c == 67644 - : c <= 67669))) - : (c <= 67702 || (c < 67828 - ? (c < 67808 - ? (c >= 67712 && c <= 67742) - : c <= 67826) - : (c <= 67829 || (c < 67872 - ? (c >= 67840 && c <= 67861) - : c <= 67883))))))))))))))); -} - -static inline bool sym__ident_regex_character_set_4(int32_t c) { - return (c < 6528 - ? (c < 2969 - ? (c < 2144 - ? (c < 1015 - ? (c < 248 - ? (c < '_' - ? (c < '-' - ? (c < '"' - ? c == ' ' - : (c <= '"' || c == '\'')) - : (c <= '-' || (c < 'A' - ? (c >= '0' && c <= '9') - : c <= 'Z'))) - : (c <= '_' || (c < 186 - ? (c < 170 - ? (c >= 'a' && c <= 'z') - : (c <= 170 || c == 181)) - : (c <= 186 || (c < 216 - ? (c >= 192 && c <= 214) - : c <= 246))))) - : (c <= 705 || (c < 890 - ? (c < 750 - ? (c < 736 - ? (c >= 710 && c <= 721) - : (c <= 740 || c == 748)) - : (c <= 750 || (c < 886 - ? (c >= 880 && c <= 884) - : c <= 887))) - : (c <= 893 || (c < 908 - ? (c < 902 - ? c == 895 - : (c <= 902 || (c >= 904 && c <= 906))) - : (c <= 908 || (c < 931 - ? (c >= 910 && c <= 929) - : c <= 1013))))))) - : (c <= 1153 || (c < 1791 - ? (c < 1568 - ? (c < 1376 - ? (c < 1329 - ? (c >= 1162 && c <= 1327) - : (c <= 1366 || c == 1369)) - : (c <= 1416 || (c < 1519 - ? (c >= 1488 && c <= 1514) - : c <= 1522))) - : (c <= 1610 || (c < 1765 - ? (c < 1649 - ? (c >= 1646 && c <= 1647) - : (c <= 1747 || c == 1749)) - : (c <= 1766 || (c < 1786 - ? (c >= 1774 && c <= 1775) - : c <= 1788))))) - : (c <= 1791 || (c < 2042 - ? (c < 1969 - ? (c < 1810 - ? c == 1808 - : (c <= 1839 || (c >= 1869 && c <= 1957))) - : (c <= 1969 || (c < 2036 - ? (c >= 1994 && c <= 2026) - : c <= 2037))) - : (c <= 2042 || (c < 2084 - ? (c < 2074 - ? (c >= 2048 && c <= 2069) - : c <= 2074) - : (c <= 2084 || (c < 2112 - ? c == 2088 - : c <= 2136))))))))) - : (c <= 2154 || (c < 2649 - ? (c < 2486 - ? (c < 2392 - ? (c < 2308 - ? (c < 2185 - ? (c >= 2160 && c <= 2183) - : (c <= 2190 || (c >= 2208 && c <= 2249))) - : (c <= 2361 || (c < 2384 - ? c == 2365 - : c <= 2384))) - : (c <= 2401 || (c < 2451 - ? (c < 2437 - ? (c >= 2417 && c <= 2432) - : (c <= 2444 || (c >= 2447 && c <= 2448))) - : (c <= 2472 || (c < 2482 - ? (c >= 2474 && c <= 2480) - : c <= 2482))))) - : (c <= 2489 || (c < 2565 - ? (c < 2527 - ? (c < 2510 - ? c == 2493 - : (c <= 2510 || (c >= 2524 && c <= 2525))) - : (c <= 2529 || (c < 2556 - ? (c >= 2544 && c <= 2545) - : c <= 2556))) - : (c <= 2570 || (c < 2610 - ? (c < 2579 - ? (c >= 2575 && c <= 2576) - : (c <= 2600 || (c >= 2602 && c <= 2608))) - : (c <= 2611 || (c < 2616 - ? (c >= 2613 && c <= 2614) - : c <= 2617))))))) - : (c <= 2652 || (c < 2831 - ? (c < 2738 - ? (c < 2703 - ? (c < 2674 - ? c == 2654 - : (c <= 2676 || (c >= 2693 && c <= 2701))) - : (c <= 2705 || (c < 2730 - ? (c >= 2707 && c <= 2728) - : c <= 2736))) - : (c <= 2739 || (c < 2784 - ? (c < 2749 - ? (c >= 2741 && c <= 2745) - : (c <= 2749 || c == 2768)) - : (c <= 2785 || (c < 2821 - ? c == 2809 - : c <= 2828))))) - : (c <= 2832 || (c < 2911 - ? (c < 2869 - ? (c < 2858 - ? (c >= 2835 && c <= 2856) - : (c <= 2864 || (c >= 2866 && c <= 2867))) - : (c <= 2873 || (c < 2908 - ? c == 2877 - : c <= 2909))) - : (c <= 2913 || (c < 2949 - ? (c < 2947 - ? c == 2929 - : c <= 2947) - : (c <= 2954 || (c < 2962 - ? (c >= 2958 && c <= 2960) - : c <= 2965))))))))))) - : (c <= 2970 || (c < 3976 - ? (c < 3389 - ? (c < 3168 - ? (c < 3077 - ? (c < 2984 - ? (c < 2974 - ? c == 2972 - : (c <= 2975 || (c >= 2979 && c <= 2980))) - : (c <= 2986 || (c < 3024 - ? (c >= 2990 && c <= 3001) - : c <= 3024))) - : (c <= 3084 || (c < 3133 - ? (c < 3090 - ? (c >= 3086 && c <= 3088) - : (c <= 3112 || (c >= 3114 && c <= 3129))) - : (c <= 3133 || (c < 3165 - ? (c >= 3160 && c <= 3162) - : c <= 3165))))) - : (c <= 3169 || (c < 3261 - ? (c < 3218 - ? (c < 3205 - ? c == 3200 - : (c <= 3212 || (c >= 3214 && c <= 3216))) - : (c <= 3240 || (c < 3253 - ? (c >= 3242 && c <= 3251) - : c <= 3257))) - : (c <= 3261 || (c < 3332 - ? (c < 3296 - ? (c >= 3293 && c <= 3294) - : (c <= 3297 || (c >= 3313 && c <= 3314))) - : (c <= 3340 || (c < 3346 - ? (c >= 3342 && c <= 3344) - : c <= 3386))))))) - : (c <= 3389 || (c < 3716 - ? (c < 3507 - ? (c < 3450 - ? (c < 3412 - ? c == 3406 - : (c <= 3414 || (c >= 3423 && c <= 3425))) - : (c <= 3455 || (c < 3482 - ? (c >= 3461 && c <= 3478) - : c <= 3505))) - : (c <= 3515 || (c < 3634 - ? (c < 3520 - ? c == 3517 - : (c <= 3526 || (c >= 3585 && c <= 3632))) - : (c <= 3635 || (c < 3713 - ? (c >= 3648 && c <= 3654) - : c <= 3714))))) - : (c <= 3716 || (c < 3776 - ? (c < 3751 - ? (c < 3724 - ? (c >= 3718 && c <= 3722) - : (c <= 3747 || c == 3749)) - : (c <= 3760 || (c < 3773 - ? (c >= 3762 && c <= 3763) - : c <= 3773))) - : (c <= 3780 || (c < 3840 - ? (c < 3804 - ? c == 3782 - : c <= 3807) - : (c <= 3840 || (c < 3913 - ? (c >= 3904 && c <= 3911) - : c <= 3948))))))))) - : (c <= 3980 || (c < 4824 - ? (c < 4348 - ? (c < 4206 - ? (c < 4186 - ? (c < 4159 - ? (c >= 4096 && c <= 4138) - : (c <= 4159 || (c >= 4176 && c <= 4181))) - : (c <= 4189 || (c < 4197 - ? c == 4193 - : c <= 4198))) - : (c <= 4208 || (c < 4295 - ? (c < 4238 - ? (c >= 4213 && c <= 4225) - : (c <= 4238 || (c >= 4256 && c <= 4293))) - : (c <= 4295 || (c < 4304 - ? c == 4301 - : c <= 4346))))) - : (c <= 4680 || (c < 4752 - ? (c < 4698 - ? (c < 4688 - ? (c >= 4682 && c <= 4685) - : (c <= 4694 || c == 4696)) - : (c <= 4701 || (c < 4746 - ? (c >= 4704 && c <= 4744) - : c <= 4749))) - : (c <= 4784 || (c < 4800 - ? (c < 4792 - ? (c >= 4786 && c <= 4789) - : c <= 4798) - : (c <= 4800 || (c < 4808 - ? (c >= 4802 && c <= 4805) - : c <= 4822))))))) - : (c <= 4880 || (c < 5984 - ? (c < 5743 - ? (c < 5024 - ? (c < 4888 - ? (c >= 4882 && c <= 4885) - : (c <= 4954 || (c >= 4992 && c <= 5007))) - : (c <= 5109 || (c < 5121 - ? (c >= 5112 && c <= 5117) - : c <= 5740))) - : (c <= 5759 || (c < 5888 - ? (c < 5792 - ? (c >= 5761 && c <= 5786) - : (c <= 5866 || (c >= 5873 && c <= 5880))) - : (c <= 5905 || (c < 5952 - ? (c >= 5919 && c <= 5937) - : c <= 5969))))) - : (c <= 5996 || (c < 6279 - ? (c < 6108 - ? (c < 6016 - ? (c >= 5998 && c <= 6000) - : (c <= 6067 || c == 6103)) - : (c <= 6108 || (c < 6272 - ? (c >= 6176 && c <= 6264) - : c <= 6276))) - : (c <= 6312 || (c < 6400 - ? (c < 6320 - ? c == 6314 - : c <= 6389) - : (c <= 6430 || (c < 6512 - ? (c >= 6480 && c <= 6509) - : c <= 6516))))))))))))) - : (c <= 6571 || (c < 43250 - ? (c < 8526 - ? (c < 8029 - ? (c < 7312 - ? (c < 7043 - ? (c < 6823 - ? (c < 6656 - ? (c >= 6576 && c <= 6601) - : (c <= 6678 || (c >= 6688 && c <= 6740))) - : (c <= 6823 || (c < 6981 - ? (c >= 6917 && c <= 6963) - : c <= 6988))) - : (c <= 7072 || (c < 7245 - ? (c < 7098 - ? (c >= 7086 && c <= 7087) - : (c <= 7141 || (c >= 7168 && c <= 7203))) - : (c <= 7247 || (c < 7296 - ? (c >= 7258 && c <= 7293) - : c <= 7304))))) - : (c <= 7354 || (c < 7680 - ? (c < 7413 - ? (c < 7401 - ? (c >= 7357 && c <= 7359) - : (c <= 7404 || (c >= 7406 && c <= 7411))) - : (c <= 7414 || (c < 7424 - ? c == 7418 - : c <= 7615))) - : (c <= 7957 || (c < 8016 - ? (c < 7968 - ? (c >= 7960 && c <= 7965) - : (c <= 8005 || (c >= 8008 && c <= 8013))) - : (c <= 8023 || (c < 8027 - ? c == 8025 - : c <= 8027))))))) - : (c <= 8029 || (c < 8336 - ? (c < 8144 - ? (c < 8126 - ? (c < 8064 - ? (c >= 8031 && c <= 8061) - : (c <= 8116 || (c >= 8118 && c <= 8124))) - : (c <= 8126 || (c < 8134 - ? (c >= 8130 && c <= 8132) - : c <= 8140))) - : (c <= 8147 || (c < 8182 - ? (c < 8160 - ? (c >= 8150 && c <= 8155) - : (c <= 8172 || (c >= 8178 && c <= 8180))) - : (c <= 8188 || (c < 8319 - ? c == 8305 - : c <= 8319))))) - : (c <= 8348 || (c < 8486 - ? (c < 8469 - ? (c < 8455 - ? c == 8450 - : (c <= 8455 || (c >= 8458 && c <= 8467))) - : (c <= 8469 || (c < 8484 - ? (c >= 8473 && c <= 8477) - : c <= 8484))) - : (c <= 8486 || (c < 8495 - ? (c < 8490 - ? c == 8488 - : c <= 8493) - : (c <= 8505 || (c < 8517 - ? (c >= 8508 && c <= 8511) - : c <= 8521))))))))) - : (c <= 8526 || (c < 12549 - ? (c < 11704 - ? (c < 11565 - ? (c < 11506 - ? (c < 11264 - ? (c >= 8579 && c <= 8580) - : (c <= 11492 || (c >= 11499 && c <= 11502))) - : (c <= 11507 || (c < 11559 - ? (c >= 11520 && c <= 11557) - : c <= 11559))) - : (c <= 11565 || (c < 11680 - ? (c < 11631 - ? (c >= 11568 && c <= 11623) - : (c <= 11631 || (c >= 11648 && c <= 11670))) - : (c <= 11686 || (c < 11696 - ? (c >= 11688 && c <= 11694) - : c <= 11702))))) - : (c <= 11710 || (c < 12337 - ? (c < 11736 - ? (c < 11720 - ? (c >= 11712 && c <= 11718) - : (c <= 11726 || (c >= 11728 && c <= 11734))) - : (c <= 11742 || (c < 12293 - ? c == 11823 - : c <= 12294))) - : (c <= 12341 || (c < 12445 - ? (c < 12353 - ? (c >= 12347 && c <= 12348) - : c <= 12438) - : (c <= 12447 || (c < 12540 - ? (c >= 12449 && c <= 12538) - : c <= 12543))))))) - : (c <= 12591 || (c < 42656 - ? (c < 40959 - ? (c < 13312 - ? (c < 12704 - ? (c >= 12593 && c <= 12686) - : (c <= 12735 || (c >= 12784 && c <= 12799))) - : (c <= 13312 || (c < 19968 - ? c == 19903 - : c <= 19968))) - : (c <= 42124 || (c < 42538 - ? (c < 42240 - ? (c >= 42192 && c <= 42237) - : (c <= 42508 || (c >= 42512 && c <= 42527))) - : (c <= 42539 || (c < 42623 - ? (c >= 42560 && c <= 42606) - : c <= 42653))))) - : (c <= 42725 || (c < 42994 - ? (c < 42960 - ? (c < 42786 - ? (c >= 42775 && c <= 42783) - : (c <= 42888 || (c >= 42891 && c <= 42954))) - : (c <= 42961 || (c < 42965 - ? c == 42963 - : c <= 42969))) - : (c <= 43009 || (c < 43020 - ? (c < 43015 - ? (c >= 43011 && c <= 43013) - : c <= 43018) - : (c <= 43042 || (c < 43138 - ? (c >= 43072 && c <= 43123) - : c <= 43187))))))))))) - : (c <= 43255 || (c < 65313 - ? (c < 43808 - ? (c < 43616 - ? (c < 43471 - ? (c < 43312 - ? (c < 43261 - ? c == 43259 - : (c <= 43262 || (c >= 43274 && c <= 43301))) - : (c <= 43334 || (c < 43396 - ? (c >= 43360 && c <= 43388) - : c <= 43442))) - : (c <= 43471 || (c < 43520 - ? (c < 43494 - ? (c >= 43488 && c <= 43492) - : (c <= 43503 || (c >= 43514 && c <= 43518))) - : (c <= 43560 || (c < 43588 - ? (c >= 43584 && c <= 43586) - : c <= 43595))))) - : (c <= 43638 || (c < 43714 - ? (c < 43701 - ? (c < 43646 - ? c == 43642 - : (c <= 43695 || c == 43697)) - : (c <= 43702 || (c < 43712 - ? (c >= 43705 && c <= 43709) - : c <= 43712))) - : (c <= 43714 || (c < 43777 - ? (c < 43744 - ? (c >= 43739 && c <= 43741) - : (c <= 43754 || (c >= 43762 && c <= 43764))) - : (c <= 43782 || (c < 43793 - ? (c >= 43785 && c <= 43790) - : c <= 43798))))))) - : (c <= 43814 || (c < 64287 - ? (c < 55216 - ? (c < 43888 - ? (c < 43824 - ? (c >= 43816 && c <= 43822) - : (c <= 43866 || (c >= 43868 && c <= 43881))) - : (c <= 44002 || (c < 55203 - ? c == 44032 - : c <= 55203))) - : (c <= 55238 || (c < 64256 - ? (c < 63744 - ? (c >= 55243 && c <= 55291) - : (c <= 64109 || (c >= 64112 && c <= 64217))) - : (c <= 64262 || (c < 64285 - ? (c >= 64275 && c <= 64279) - : c <= 64285))))) - : (c <= 64296 || (c < 64467 - ? (c < 64320 - ? (c < 64312 - ? (c >= 64298 && c <= 64310) - : (c <= 64316 || c == 64318)) - : (c <= 64321 || (c < 64326 - ? (c >= 64323 && c <= 64324) - : c <= 64433))) - : (c <= 64829 || (c < 65008 - ? (c < 64914 - ? (c >= 64848 && c <= 64911) - : c <= 64967) - : (c <= 65019 || (c < 65142 - ? (c >= 65136 && c <= 65140) - : c <= 65276))))))))) - : (c <= 65338 || (c < 66864 - ? (c < 66176 - ? (c < 65536 - ? (c < 65482 - ? (c < 65382 - ? (c >= 65345 && c <= 65370) - : (c <= 65470 || (c >= 65474 && c <= 65479))) - : (c <= 65487 || (c < 65498 - ? (c >= 65490 && c <= 65495) - : c <= 65500))) - : (c <= 65547 || (c < 65599 - ? (c < 65576 - ? (c >= 65549 && c <= 65574) - : (c <= 65594 || (c >= 65596 && c <= 65597))) - : (c <= 65613 || (c < 65664 - ? (c >= 65616 && c <= 65629) - : c <= 65786))))) - : (c <= 66204 || (c < 66464 - ? (c < 66370 - ? (c < 66304 - ? (c >= 66208 && c <= 66256) - : (c <= 66335 || (c >= 66349 && c <= 66368))) - : (c <= 66377 || (c < 66432 - ? (c >= 66384 && c <= 66421) - : c <= 66461))) - : (c <= 66499 || (c < 66736 - ? (c < 66560 - ? (c >= 66504 && c <= 66511) - : c <= 66717) - : (c <= 66771 || (c < 66816 - ? (c >= 66776 && c <= 66811) - : c <= 66855))))))) - : (c <= 66915 || (c < 67506 - ? (c < 66995 - ? (c < 66964 - ? (c < 66940 - ? (c >= 66928 && c <= 66938) - : (c <= 66954 || (c >= 66956 && c <= 66962))) - : (c <= 66965 || (c < 66979 - ? (c >= 66967 && c <= 66977) - : c <= 66993))) - : (c <= 67001 || (c < 67424 - ? (c < 67072 - ? (c >= 67003 && c <= 67004) - : (c <= 67382 || (c >= 67392 && c <= 67413))) - : (c <= 67431 || (c < 67463 - ? (c >= 67456 && c <= 67461) - : c <= 67504))))) - : (c <= 67514 || (c < 67680 - ? (c < 67639 - ? (c < 67592 - ? (c >= 67584 && c <= 67589) - : (c <= 67592 || (c >= 67594 && c <= 67637))) - : (c <= 67640 || (c < 67647 - ? c == 67644 - : c <= 67669))) - : (c <= 67702 || (c < 67828 - ? (c < 67808 - ? (c >= 67712 && c <= 67742) - : c <= 67826) - : (c <= 67829 || (c < 67872 - ? (c >= 67840 && c <= 67861) - : c <= 67883))))))))))))))); -} - static bool ts_lex(TSLexer *lexer, TSStateId state) { START_LEXER(); eof = lexer->eof(lexer); switch (state) { case 0: - if (eof) ADVANCE(27); - if (lookahead == '#') ADVANCE(51); - if (lookahead == '-') ADVANCE(7); - if (lookahead == '.') ADVANCE(42); - if (lookahead == ':') ADVANCE(29); - if (lookahead == ';') ADVANCE(34); + if (eof) ADVANCE(26); + if (lookahead == '#') ADVANCE(1); + if (lookahead == '-') ADVANCE(39); + if (lookahead == '.') ADVANCE(40); + if (lookahead == ':') ADVANCE(28); + if (lookahead == ';') ADVANCE(33); if (lookahead == '<') ADVANCE(6); - if (lookahead == 'd') ADVANCE(14); - if (lookahead == 'l') ADVANCE(9); - if (lookahead == 'r') ADVANCE(15); - if (lookahead == 'u') ADVANCE(20); - if (lookahead == '|') ADVANCE(37); + if (lookahead == 'd') ADVANCE(13); + if (lookahead == 'l') ADVANCE(8); + if (lookahead == 'r') ADVANCE(14); + if (lookahead == 'u') ADVANCE(19); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') SKIP(0) END_STATE(); case 1: - if (lookahead == '\n') ADVANCE(35); - if (lookahead == ' ') ADVANCE(46); - if (lookahead == '-') ADVANCE(49); - if (lookahead == '.') ADVANCE(42); - if (lookahead == ':') ADVANCE(29); - if (lookahead == ';') ADVANCE(34); - if (lookahead == '<') ADVANCE(6); - if (lookahead == '\t' || - lookahead == '\r') SKIP(1) - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(50); + if (lookahead == '\n') ADVANCE(48); + if (lookahead != 0) ADVANCE(1); END_STATE(); case 2: - if (lookahead == '\n') ADVANCE(36); - if (lookahead == ':') ADVANCE(29); - if (lookahead == ';') ADVANCE(34); + if (lookahead == '\n') ADVANCE(34); + if (lookahead == ' ') ADVANCE(45); + if (lookahead == '-') ADVANCE(39); + if (lookahead == '.') ADVANCE(40); + if (lookahead == ':') ADVANCE(28); + if (lookahead == ';') ADVANCE(33); + if (lookahead == '<') ADVANCE(6); if (lookahead == '\t' || - lookahead == '\r' || - lookahead == ' ') SKIP(2) + lookahead == '\r') SKIP(2) + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(47); END_STATE(); case 3: - if (lookahead == '\n') SKIP(3) - if (lookahead == '|') ADVANCE(38); + if (lookahead == '\n') ADVANCE(35); + if (lookahead == ';') ADVANCE(33); if (lookahead == '\t' || lookahead == '\r' || - lookahead == ' ') ADVANCE(39); - if (lookahead != 0) ADVANCE(41); + lookahead == ' ') SKIP(3) END_STATE(); case 4: if (lookahead == '\n') SKIP(4) if (lookahead == '\t' || lookahead == '\r' || - lookahead == ' ') ADVANCE(40); - if (lookahead != 0) ADVANCE(41); + lookahead == ' ') ADVANCE(36); + if (lookahead != 0) ADVANCE(37); END_STATE(); case 5: - if (lookahead == ' ') ADVANCE(48); + if (lookahead == ' ') ADVANCE(46); + if (lookahead == '-') ADVANCE(38); + if (lookahead == '.') ADVANCE(40); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r') SKIP(5) - if (sym__ident_regex_character_set_2(lookahead)) ADVANCE(50); + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(47); END_STATE(); case 6: - if (lookahead == '-') ADVANCE(44); + if (lookahead == '-') ADVANCE(42); END_STATE(); case 7: - if (lookahead == '-') ADVANCE(44); - if (lookahead == '>') ADVANCE(43); + if (lookahead == 'c') ADVANCE(23); END_STATE(); case 8: - if (lookahead == 'c') ADVANCE(24); + if (lookahead == 'e') ADVANCE(10); END_STATE(); case 9: - if (lookahead == 'e') ADVANCE(11); + if (lookahead == 'e') ADVANCE(7); END_STATE(); case 10: - if (lookahead == 'e') ADVANCE(8); + if (lookahead == 'f') ADVANCE(21); END_STATE(); case 11: - if (lookahead == 'f') ADVANCE(22); + if (lookahead == 'g') ADVANCE(12); END_STATE(); case 12: - if (lookahead == 'g') ADVANCE(13); + if (lookahead == 'h') ADVANCE(22); END_STATE(); case 13: - if (lookahead == 'h') ADVANCE(23); + if (lookahead == 'i') ADVANCE(20); + if (lookahead == 'o') ADVANCE(24); END_STATE(); case 14: - if (lookahead == 'i') ADVANCE(21); - if (lookahead == 'o') ADVANCE(25); + if (lookahead == 'i') ADVANCE(11); END_STATE(); case 15: - if (lookahead == 'i') ADVANCE(12); + if (lookahead == 'i') ADVANCE(18); END_STATE(); case 16: - if (lookahead == 'i') ADVANCE(19); + if (lookahead == 'n') ADVANCE(32); END_STATE(); case 17: - if (lookahead == 'n') ADVANCE(33); + if (lookahead == 'n') ADVANCE(27); END_STATE(); case 18: - if (lookahead == 'n') ADVANCE(28); + if (lookahead == 'o') ADVANCE(17); END_STATE(); case 19: - if (lookahead == 'o') ADVANCE(18); + if (lookahead == 'p') ADVANCE(29); END_STATE(); case 20: - if (lookahead == 'p') ADVANCE(30); + if (lookahead == 'r') ADVANCE(9); END_STATE(); case 21: - if (lookahead == 'r') ADVANCE(10); + if (lookahead == 't') ADVANCE(31); END_STATE(); case 22: - if (lookahead == 't') ADVANCE(32); + if (lookahead == 't') ADVANCE(30); END_STATE(); case 23: - if (lookahead == 't') ADVANCE(31); + if (lookahead == 't') ADVANCE(15); END_STATE(); case 24: - if (lookahead == 't') ADVANCE(16); + if (lookahead == 'w') ADVANCE(16); END_STATE(); case 25: - if (lookahead == 'w') ADVANCE(17); - END_STATE(); - case 26: - if (eof) ADVANCE(27); - if (lookahead == ' ') ADVANCE(47); - if (lookahead == '-') ADVANCE(49); + if (eof) ADVANCE(26); + if (lookahead == ' ') ADVANCE(46); + if (lookahead == '-') ADVANCE(39); + if (lookahead == '.') ADVANCE(40); if (lookahead == '<') ADVANCE(6); if (lookahead == '\t' || lookahead == '\n' || - lookahead == '\r') SKIP(26) - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(50); + lookahead == '\r') SKIP(25) + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(47); END_STATE(); - case 27: + case 26: ACCEPT_TOKEN(ts_builtin_sym_end); END_STATE(); - case 28: + case 27: ACCEPT_TOKEN(anon_sym_direction); END_STATE(); - case 29: + case 28: ACCEPT_TOKEN(anon_sym_COLON); END_STATE(); - case 30: + case 29: ACCEPT_TOKEN(anon_sym_up); END_STATE(); - case 31: + case 30: ACCEPT_TOKEN(anon_sym_right); END_STATE(); - case 32: + case 31: ACCEPT_TOKEN(anon_sym_left); END_STATE(); - case 33: + case 32: ACCEPT_TOKEN(anon_sym_down); END_STATE(); - case 34: + case 33: ACCEPT_TOKEN(anon_sym_SEMI); END_STATE(); + case 34: + ACCEPT_TOKEN(aux_sym_expression_token1); + if (lookahead == '\n') ADVANCE(34); + if (lookahead == ' ') ADVANCE(45); + END_STATE(); case 35: ACCEPT_TOKEN(aux_sym_expression_token1); if (lookahead == '\n') ADVANCE(35); - if (lookahead == ' ') ADVANCE(46); END_STATE(); case 36: - ACCEPT_TOKEN(aux_sym_expression_token1); - if (lookahead == '\n') ADVANCE(36); + ACCEPT_TOKEN(aux_sym_label_token1); + if (lookahead == '\t' || + lookahead == '\r' || + lookahead == ' ') ADVANCE(36); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(37); END_STATE(); case 37: - ACCEPT_TOKEN(anon_sym_PIPE); + ACCEPT_TOKEN(aux_sym_label_token1); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(37); END_STATE(); case 38: - ACCEPT_TOKEN(anon_sym_PIPE); - if (lookahead != 0 && - lookahead != '\n') ADVANCE(41); + ACCEPT_TOKEN(anon_sym_DASH); END_STATE(); case 39: - ACCEPT_TOKEN(aux_sym_shape_label_token1); - if (lookahead == '|') ADVANCE(38); - if (lookahead == '\t' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(39); - if (lookahead != 0 && - lookahead != '\n') ADVANCE(41); + ACCEPT_TOKEN(anon_sym_DASH); + if (lookahead == '-') ADVANCE(41); + if (lookahead == '>') ADVANCE(43); END_STATE(); case 40: - ACCEPT_TOKEN(aux_sym_shape_label_token1); - if (lookahead == '\t' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(40); - if (lookahead != 0 && - lookahead != '\n') ADVANCE(41); + ACCEPT_TOKEN(anon_sym_DOT); END_STATE(); case 41: - ACCEPT_TOKEN(aux_sym_shape_label_token1); - if (lookahead != 0 && - lookahead != '\n') ADVANCE(41); + ACCEPT_TOKEN(aux_sym_connection_token1); + if (lookahead == '-') ADVANCE(41); + if (lookahead == '>') ADVANCE(43); END_STATE(); case 42: - ACCEPT_TOKEN(anon_sym_DOT); + ACCEPT_TOKEN(aux_sym_connection_token2); + if (lookahead == '-') ADVANCE(42); + if (lookahead == '>') ADVANCE(44); END_STATE(); case 43: - ACCEPT_TOKEN(sym_connection); + ACCEPT_TOKEN(aux_sym_connection_token3); END_STATE(); case 44: - ACCEPT_TOKEN(sym_connection); - if (lookahead == '-') ADVANCE(44); - if (lookahead == '>') ADVANCE(43); + ACCEPT_TOKEN(aux_sym_connection_token4); END_STATE(); case 45: - ACCEPT_TOKEN(sym_connection); - if (lookahead == '-') ADVANCE(45); - if (lookahead == '>') ADVANCE(43); - if (sym__ident_regex_character_set_3(lookahead)) ADVANCE(50); + ACCEPT_TOKEN(sym__ident_regex); + if (lookahead == '\n') ADVANCE(34); + if (lookahead == ' ') ADVANCE(45); + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(47); END_STATE(); case 46: ACCEPT_TOKEN(sym__ident_regex); - if (lookahead == '\n') ADVANCE(35); if (lookahead == ' ') ADVANCE(46); - if (lookahead == '-') ADVANCE(49); - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(50); + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(47); END_STATE(); case 47: ACCEPT_TOKEN(sym__ident_regex); - if (lookahead == ' ') ADVANCE(47); - if (lookahead == '-') ADVANCE(49); - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(50); + if (sym__ident_regex_character_set_2(lookahead)) ADVANCE(47); END_STATE(); case 48: - ACCEPT_TOKEN(sym__ident_regex); - if (lookahead == ' ') ADVANCE(48); - if (sym__ident_regex_character_set_2(lookahead)) ADVANCE(50); - END_STATE(); - case 49: - ACCEPT_TOKEN(sym__ident_regex); - if (lookahead == '-') ADVANCE(45); - if (lookahead == '>') ADVANCE(43); - if (sym__ident_regex_character_set_3(lookahead)) ADVANCE(50); - END_STATE(); - case 50: - ACCEPT_TOKEN(sym__ident_regex); - if (sym__ident_regex_character_set_4(lookahead)) ADVANCE(50); - END_STATE(); - case 51: ACCEPT_TOKEN(sym__comment); - if (lookahead != 0 && - lookahead != '\n') ADVANCE(51); END_STATE(); default: return false; @@ -2531,25 +1499,22 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { static const TSLexMode ts_lex_modes[STATE_COUNT] = { [0] = {.lex_state = 0}, - [1] = {.lex_state = 26}, - [2] = {.lex_state = 26}, - [3] = {.lex_state = 26}, - [4] = {.lex_state = 1}, - [5] = {.lex_state = 1}, - [6] = {.lex_state = 1}, - [7] = {.lex_state = 1}, - [8] = {.lex_state = 1}, + [1] = {.lex_state = 25}, + [2] = {.lex_state = 2}, + [3] = {.lex_state = 25}, + [4] = {.lex_state = 25}, + [5] = {.lex_state = 2}, + [6] = {.lex_state = 2}, + [7] = {.lex_state = 2}, + [8] = {.lex_state = 2}, [9] = {.lex_state = 2}, - [10] = {.lex_state = 26}, - [11] = {.lex_state = 26}, + [10] = {.lex_state = 25}, + [11] = {.lex_state = 25}, [12] = {.lex_state = 5}, [13] = {.lex_state = 3}, - [14] = {.lex_state = 2}, - [15] = {.lex_state = 2}, - [16] = {.lex_state = 2}, - [17] = {.lex_state = 0}, - [18] = {.lex_state = 4}, - [19] = {.lex_state = 0}, + [14] = {.lex_state = 3}, + [15] = {.lex_state = 0}, + [16] = {.lex_state = 4}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { @@ -2562,220 +1527,265 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_left] = ACTIONS(1), [anon_sym_down] = ACTIONS(1), [anon_sym_SEMI] = ACTIONS(1), - [anon_sym_PIPE] = ACTIONS(1), + [anon_sym_DASH] = ACTIONS(1), [anon_sym_DOT] = ACTIONS(1), - [sym_connection] = ACTIONS(1), + [aux_sym_connection_token1] = ACTIONS(1), + [aux_sym_connection_token2] = ACTIONS(1), + [aux_sym_connection_token3] = ACTIONS(1), + [aux_sym_connection_token4] = ACTIONS(1), [sym__comment] = ACTIONS(1), }, [1] = { - [sym_source_file] = STATE(17), - [sym_expression] = STATE(2), - [sym_shape_title] = STATE(9), - [sym_identifier] = STATE(5), - [aux_sym_source_file_repeat1] = STATE(2), - [aux_sym_shape_title_repeat1] = STATE(5), + [sym_source_file] = STATE(15), + [sym_expression] = STATE(3), + [sym_identifier] = STATE(2), + [sym_sub_identifier] = STATE(6), + [sym_connection] = STATE(2), + [aux_sym_source_file_repeat1] = STATE(3), + [aux_sym_expression_repeat1] = STATE(2), + [aux_sym_identifier_repeat1] = STATE(6), [ts_builtin_sym_end] = ACTIONS(3), - [sym_connection] = ACTIONS(5), - [sym__ident_regex] = ACTIONS(7), + [anon_sym_DASH] = ACTIONS(5), + [anon_sym_DOT] = ACTIONS(7), + [aux_sym_connection_token1] = ACTIONS(9), + [aux_sym_connection_token2] = ACTIONS(9), + [aux_sym_connection_token3] = ACTIONS(9), + [aux_sym_connection_token4] = ACTIONS(9), + [sym__ident_regex] = ACTIONS(11), + }, + [2] = { + [sym_label] = STATE(13), + [sym_identifier] = STATE(5), + [sym_sub_identifier] = STATE(6), + [sym_connection] = STATE(5), + [aux_sym_expression_repeat1] = STATE(5), + [aux_sym_identifier_repeat1] = STATE(6), + [anon_sym_COLON] = ACTIONS(13), + [anon_sym_SEMI] = ACTIONS(15), + [aux_sym_expression_token1] = ACTIONS(15), + [anon_sym_DASH] = ACTIONS(5), + [anon_sym_DOT] = ACTIONS(7), + [aux_sym_connection_token1] = ACTIONS(9), + [aux_sym_connection_token2] = ACTIONS(9), + [aux_sym_connection_token3] = ACTIONS(9), + [aux_sym_connection_token4] = ACTIONS(9), + [sym__ident_regex] = ACTIONS(5), + }, + [3] = { + [sym_expression] = STATE(4), + [sym_identifier] = STATE(2), + [sym_sub_identifier] = STATE(6), + [sym_connection] = STATE(2), + [aux_sym_source_file_repeat1] = STATE(4), + [aux_sym_expression_repeat1] = STATE(2), + [aux_sym_identifier_repeat1] = STATE(6), + [ts_builtin_sym_end] = ACTIONS(17), + [anon_sym_DASH] = ACTIONS(5), + [anon_sym_DOT] = ACTIONS(7), + [aux_sym_connection_token1] = ACTIONS(9), + [aux_sym_connection_token2] = ACTIONS(9), + [aux_sym_connection_token3] = ACTIONS(9), + [aux_sym_connection_token4] = ACTIONS(9), + [sym__ident_regex] = ACTIONS(11), + }, + [4] = { + [sym_expression] = STATE(4), + [sym_identifier] = STATE(2), + [sym_sub_identifier] = STATE(6), + [sym_connection] = STATE(2), + [aux_sym_source_file_repeat1] = STATE(4), + [aux_sym_expression_repeat1] = STATE(2), + [aux_sym_identifier_repeat1] = STATE(6), + [ts_builtin_sym_end] = ACTIONS(19), + [anon_sym_DASH] = ACTIONS(21), + [anon_sym_DOT] = ACTIONS(24), + [aux_sym_connection_token1] = ACTIONS(27), + [aux_sym_connection_token2] = ACTIONS(27), + [aux_sym_connection_token3] = ACTIONS(27), + [aux_sym_connection_token4] = ACTIONS(27), + [sym__ident_regex] = ACTIONS(30), + }, + [5] = { + [sym_identifier] = STATE(5), + [sym_sub_identifier] = STATE(6), + [sym_connection] = STATE(5), + [aux_sym_expression_repeat1] = STATE(5), + [aux_sym_identifier_repeat1] = STATE(6), + [anon_sym_COLON] = ACTIONS(33), + [anon_sym_SEMI] = ACTIONS(33), + [aux_sym_expression_token1] = ACTIONS(33), + [anon_sym_DASH] = ACTIONS(35), + [anon_sym_DOT] = ACTIONS(38), + [aux_sym_connection_token1] = ACTIONS(41), + [aux_sym_connection_token2] = ACTIONS(41), + [aux_sym_connection_token3] = ACTIONS(41), + [aux_sym_connection_token4] = ACTIONS(41), + [sym__ident_regex] = ACTIONS(35), }, }; static const uint16_t ts_small_parse_table[] = { - [0] = 6, - ACTIONS(5), 1, - sym_connection, + [0] = 4, ACTIONS(7), 1, - sym__ident_regex, - ACTIONS(9), 1, - ts_builtin_sym_end, - STATE(9), 1, - sym_shape_title, - STATE(3), 2, - sym_expression, - aux_sym_source_file_repeat1, - STATE(5), 2, - sym_identifier, - aux_sym_shape_title_repeat1, - [21] = 6, - ACTIONS(11), 1, - ts_builtin_sym_end, - ACTIONS(13), 1, - sym_connection, - ACTIONS(16), 1, - sym__ident_regex, - STATE(9), 1, - sym_shape_title, - STATE(3), 2, - sym_expression, - aux_sym_source_file_repeat1, - STATE(5), 2, - sym_identifier, - aux_sym_shape_title_repeat1, - [42] = 3, - ACTIONS(21), 1, anon_sym_DOT, - STATE(7), 1, - sym_sub_identifier, - ACTIONS(19), 5, - anon_sym_COLON, - anon_sym_SEMI, - aux_sym_expression_token1, - sym_connection, - sym__ident_regex, - [56] = 4, - ACTIONS(7), 1, + ACTIONS(46), 2, + anon_sym_DASH, sym__ident_regex, - ACTIONS(25), 1, - sym_connection, - STATE(6), 2, - sym_identifier, - aux_sym_shape_title_repeat1, - ACTIONS(23), 3, + STATE(7), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + ACTIONS(44), 7, anon_sym_COLON, anon_sym_SEMI, aux_sym_expression_token1, - [72] = 4, - ACTIONS(29), 1, - sym_connection, - ACTIONS(32), 1, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + [21] = 4, + ACTIONS(53), 1, + anon_sym_DOT, + ACTIONS(50), 2, + anon_sym_DASH, sym__ident_regex, - STATE(6), 2, - sym_identifier, - aux_sym_shape_title_repeat1, - ACTIONS(27), 3, + STATE(7), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + ACTIONS(48), 7, anon_sym_COLON, anon_sym_SEMI, aux_sym_expression_token1, - [88] = 1, - ACTIONS(35), 5, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + [42] = 1, + ACTIONS(56), 10, anon_sym_COLON, anon_sym_SEMI, aux_sym_expression_token1, - sym_connection, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, sym__ident_regex, - [96] = 1, - ACTIONS(37), 5, + [55] = 1, + ACTIONS(58), 10, anon_sym_COLON, anon_sym_SEMI, aux_sym_expression_token1, - sym_connection, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, sym__ident_regex, - [104] = 4, - ACTIONS(39), 1, - anon_sym_COLON, - ACTIONS(41), 1, - anon_sym_SEMI, - ACTIONS(43), 1, - aux_sym_expression_token1, - STATE(14), 1, - sym_shape_label, - [117] = 2, - ACTIONS(45), 1, + [68] = 2, + ACTIONS(60), 2, ts_builtin_sym_end, - ACTIONS(47), 2, - sym_connection, sym__ident_regex, - [125] = 2, - ACTIONS(49), 1, + ACTIONS(62), 6, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + [81] = 2, + ACTIONS(64), 2, ts_builtin_sym_end, - ACTIONS(51), 2, - sym_connection, sym__ident_regex, - [133] = 2, - ACTIONS(53), 1, + ACTIONS(66), 6, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + [94] = 5, + ACTIONS(5), 1, + anon_sym_DASH, + ACTIONS(7), 1, + anon_sym_DOT, + ACTIONS(11), 1, sym__ident_regex, - STATE(8), 1, + STATE(9), 1, sym_identifier, - [140] = 2, - ACTIONS(55), 1, - anon_sym_PIPE, - ACTIONS(57), 1, - aux_sym_shape_label_token1, - [147] = 2, - ACTIONS(59), 1, - anon_sym_SEMI, - ACTIONS(61), 1, - aux_sym_expression_token1, - [154] = 2, - ACTIONS(63), 1, + STATE(6), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + [111] = 2, + ACTIONS(68), 1, anon_sym_SEMI, - ACTIONS(65), 1, + ACTIONS(70), 1, aux_sym_expression_token1, - [161] = 2, - ACTIONS(67), 1, + [118] = 2, + ACTIONS(72), 1, anon_sym_SEMI, - ACTIONS(69), 1, + ACTIONS(74), 1, aux_sym_expression_token1, - [168] = 1, - ACTIONS(71), 1, + [125] = 1, + ACTIONS(76), 1, ts_builtin_sym_end, - [172] = 1, - ACTIONS(73), 1, - aux_sym_shape_label_token1, - [176] = 1, - ACTIONS(75), 1, - anon_sym_PIPE, + [129] = 1, + ACTIONS(78), 1, + aux_sym_label_token1, }; static const uint32_t ts_small_parse_table_map[] = { - [SMALL_STATE(2)] = 0, - [SMALL_STATE(3)] = 21, - [SMALL_STATE(4)] = 42, - [SMALL_STATE(5)] = 56, - [SMALL_STATE(6)] = 72, - [SMALL_STATE(7)] = 88, - [SMALL_STATE(8)] = 96, - [SMALL_STATE(9)] = 104, - [SMALL_STATE(10)] = 117, - [SMALL_STATE(11)] = 125, - [SMALL_STATE(12)] = 133, - [SMALL_STATE(13)] = 140, - [SMALL_STATE(14)] = 147, - [SMALL_STATE(15)] = 154, - [SMALL_STATE(16)] = 161, - [SMALL_STATE(17)] = 168, - [SMALL_STATE(18)] = 172, - [SMALL_STATE(19)] = 176, + [SMALL_STATE(6)] = 0, + [SMALL_STATE(7)] = 21, + [SMALL_STATE(8)] = 42, + [SMALL_STATE(9)] = 55, + [SMALL_STATE(10)] = 68, + [SMALL_STATE(11)] = 81, + [SMALL_STATE(12)] = 94, + [SMALL_STATE(13)] = 111, + [SMALL_STATE(14)] = 118, + [SMALL_STATE(15)] = 125, + [SMALL_STATE(16)] = 129, }; 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_source_file, 0), - [5] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5), - [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(4), - [9] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), - [11] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), - [13] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(5), - [16] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(4), - [19] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_identifier, 1), - [21] = {.entry = {.count = 1, .reusable = false}}, SHIFT(12), - [23] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_shape_title, 1), - [25] = {.entry = {.count = 1, .reusable = false}}, SHIFT(6), - [27] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_shape_title_repeat1, 2), - [29] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_shape_title_repeat1, 2), SHIFT_REPEAT(6), - [32] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_shape_title_repeat1, 2), SHIFT_REPEAT(4), - [35] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_identifier, 2), - [37] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sub_identifier, 2), - [39] = {.entry = {.count = 1, .reusable = false}}, SHIFT(13), - [41] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10), - [43] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), - [45] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 2), - [47] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 2), - [49] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 3), - [51] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 3), - [53] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), - [55] = {.entry = {.count = 1, .reusable = false}}, SHIFT(18), - [57] = {.entry = {.count = 1, .reusable = false}}, SHIFT(15), - [59] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11), - [61] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), - [63] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_shape_label, 2), - [65] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_shape_label, 2), - [67] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_shape_label, 4), - [69] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_shape_label, 4), - [71] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), - [73] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), - [75] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), + [5] = {.entry = {.count = 1, .reusable = false}}, SHIFT(6), + [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(12), + [9] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), + [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), + [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(16), + [15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10), + [17] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), + [19] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), + [21] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(6), + [24] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(12), + [27] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(8), + [30] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(6), + [33] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), + [35] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(6), + [38] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(12), + [41] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(8), + [44] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_identifier, 1), + [46] = {.entry = {.count = 1, .reusable = false}}, SHIFT(7), + [48] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), + [50] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(7), + [53] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(12), + [56] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_connection, 1), + [58] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sub_identifier, 2), + [60] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 2), + [62] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 2), + [64] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 3), + [66] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 3), + [68] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11), + [70] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [72] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_label, 2), + [74] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_label, 2), + [76] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [78] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), }; #ifdef __cplusplus diff --git a/test/corpus/connections.txt b/test/corpus/connections.txt index 390b0b1..29f2f6c 100644 --- a/test/corpus/connections.txt +++ b/test/corpus/connections.txt @@ -41,18 +41,49 @@ Isolated long connections (connection))) ==================||| -Invalid connections +Invalid connection "-" ==================||| - + +---||| + +(source_file + (expression + (identifier))) + +==================||| +Invalid connection ">" +==================||| + > + +---||| + +(source_file + (ERROR + (UNEXPECTED '>'))) + +==================||| +Invalid connection "<" +==================||| + < + +---||| + +(source_file + (ERROR + (UNEXPECTED '\n'))) + +==================||| +Invalid connection "<>" +==================||| + <> ---||| (source_file - (expression - (identifier)) (ERROR - (UNEXPECTED '>'))) + (UNEXPECTED '>'))) \ No newline at end of file diff --git a/test/corpus/containers.txt b/test/corpus/containers.txt new file mode 100644 index 0000000..93afb1f --- /dev/null +++ b/test/corpus/containers.txt @@ -0,0 +1,52 @@ +================== +Base Container +================== + +Cloud.shape: cloud + +--- + +(source_file + (expression + (identifier + (sub_identifier + (identifier))) + (label))) + +================== +Container With Spaces +================== + +im a parent.im a child + +--- + +(source_file + (expression + (identifier + (sub_identifier + (identifier))))) + + +================== +Complex container +================== + +apartment.Bedroom.Bathroom -> office.Spare Room.Bathroom: Portal + +--- + +(source_file + (expression + (identifier + (sub_identifier + (identifier + (sub_identifier + (identifier))))) + (connection) + (identifier + (sub_identifier + (identifier + (sub_identifier + (identifier))))) + (label))) \ No newline at end of file From 6b8e9010cc82369f9dcd491db61259d3dcad5172 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 22 Jul 2023 10:28:37 +0300 Subject: [PATCH 04/11] feat: add multiline connections --- grammar.js | 17 +- src/grammar.json | 150 ++++++++--- src/parser.c | 521 ++++++++++++++++++++++-------------- test/corpus/connections.txt | 81 +++++- 4 files changed, 522 insertions(+), 247 deletions(-) diff --git a/grammar.js b/grammar.js index e3b5a84..04f8d49 100644 --- a/grammar.js +++ b/grammar.js @@ -7,7 +7,10 @@ module.exports = grammar({ $.expression, )), - extras: $ => choice($._comment, /\s+/), + extras: $ => choice( + $._comment, + /\s+/, + ), direction: _ => seq("direction", ":", choice( "up", @@ -16,14 +19,14 @@ module.exports = grammar({ "down" )), - expression: $ => seq( + expression: $ => prec.right(seq( repeat1(choice( $.identifier, $.connection, )), optional($.label), - choice(";", /\n+/), - ), + optional(choice(/\n+/, ";")), + )), label: _ => seq(":", choice( // seq("|", /.+/, "|"), @@ -67,6 +70,12 @@ module.exports = grammar({ /<-+/, /-+>/, /<-+>/, + + // Multiline arrows + seq(/--+/, /\\\n+\s+/, /--+/), + seq(/<-+/, /\\\n+\s+/, /--+/), + seq(/--+/, /\\\n+\s+/, /-+>/), + seq(/<-+/, /\\\n+\s+/, /-+>/), ), // param_value: _ => /[\w\-_]+/i, diff --git a/src/grammar.json b/src/grammar.json index 4e860c4..1572ce6 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -61,50 +61,62 @@ ] }, "expression": { - "type": "SEQ", - "members": [ - { - "type": "REPEAT1", - "content": { + "type": "PREC_RIGHT", + "value": 0, + "content": { + "type": "SEQ", + "members": [ + { + "type": "REPEAT1", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "identifier" + }, + { + "type": "SYMBOL", + "name": "connection" + } + ] + } + }, + { "type": "CHOICE", "members": [ { "type": "SYMBOL", - "name": "identifier" + "name": "label" }, { - "type": "SYMBOL", - "name": "connection" + "type": "BLANK" + } + ] + }, + { + "type": "CHOICE", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "PATTERN", + "value": "\\n+" + }, + { + "type": "STRING", + "value": ";" + } + ] + }, + { + "type": "BLANK" } ] } - }, - { - "type": "CHOICE", - "members": [ - { - "type": "SYMBOL", - "name": "label" - }, - { - "type": "BLANK" - } - ] - }, - { - "type": "CHOICE", - "members": [ - { - "type": "STRING", - "value": ";" - }, - { - "type": "PATTERN", - "value": "\\n+" - } - ] - } - ] + ] + } }, "label": { "type": "SEQ", @@ -179,6 +191,74 @@ { "type": "PATTERN", "value": "<-+>" + }, + { + "type": "SEQ", + "members": [ + { + "type": "PATTERN", + "value": "--+" + }, + { + "type": "PATTERN", + "value": "\\\\\\n+\\s+" + }, + { + "type": "PATTERN", + "value": "--+" + } + ] + }, + { + "type": "SEQ", + "members": [ + { + "type": "PATTERN", + "value": "<-+" + }, + { + "type": "PATTERN", + "value": "\\\\\\n+\\s+" + }, + { + "type": "PATTERN", + "value": "--+" + } + ] + }, + { + "type": "SEQ", + "members": [ + { + "type": "PATTERN", + "value": "--+" + }, + { + "type": "PATTERN", + "value": "\\\\\\n+\\s+" + }, + { + "type": "PATTERN", + "value": "-+>" + } + ] + }, + { + "type": "SEQ", + "members": [ + { + "type": "PATTERN", + "value": "<-+" + }, + { + "type": "PATTERN", + "value": "\\\\\\n+\\s+" + }, + { + "type": "PATTERN", + "value": "-+>" + } + ] } ] }, diff --git a/src/parser.c b/src/parser.c index 5e58e59..22240a6 100644 --- a/src/parser.c +++ b/src/parser.c @@ -6,11 +6,11 @@ #endif #define LANGUAGE_VERSION 14 -#define STATE_COUNT 17 +#define STATE_COUNT 20 #define LARGE_STATE_COUNT 6 -#define SYMBOL_COUNT 27 +#define SYMBOL_COUNT 28 #define ALIAS_COUNT 0 -#define TOKEN_COUNT 18 +#define TOKEN_COUNT 19 #define EXTERNAL_TOKEN_COUNT 0 #define FIELD_COUNT 0 #define MAX_ALIAS_SEQUENCE_LENGTH 3 @@ -23,8 +23,8 @@ enum { anon_sym_right = 4, anon_sym_left = 5, anon_sym_down = 6, - anon_sym_SEMI = 7, - aux_sym_expression_token1 = 8, + aux_sym_expression_token1 = 7, + anon_sym_SEMI = 8, aux_sym_label_token1 = 9, anon_sym_DASH = 10, anon_sym_DOT = 11, @@ -32,17 +32,18 @@ enum { aux_sym_connection_token2 = 13, aux_sym_connection_token3 = 14, aux_sym_connection_token4 = 15, - sym__ident_regex = 16, - sym__comment = 17, - sym_source_file = 18, - sym_expression = 19, - sym_label = 20, - sym_identifier = 21, - sym_sub_identifier = 22, - sym_connection = 23, - aux_sym_source_file_repeat1 = 24, - aux_sym_expression_repeat1 = 25, - aux_sym_identifier_repeat1 = 26, + aux_sym_connection_token5 = 16, + sym__ident_regex = 17, + sym__comment = 18, + sym_source_file = 19, + sym_expression = 20, + sym_label = 21, + sym_identifier = 22, + sym_sub_identifier = 23, + sym_connection = 24, + aux_sym_source_file_repeat1 = 25, + aux_sym_expression_repeat1 = 26, + aux_sym_identifier_repeat1 = 27, }; static const char * const ts_symbol_names[] = { @@ -53,8 +54,8 @@ static const char * const ts_symbol_names[] = { [anon_sym_right] = "right", [anon_sym_left] = "left", [anon_sym_down] = "down", - [anon_sym_SEMI] = ";", [aux_sym_expression_token1] = "expression_token1", + [anon_sym_SEMI] = ";", [aux_sym_label_token1] = "label_token1", [anon_sym_DASH] = "-", [anon_sym_DOT] = ".", @@ -62,6 +63,7 @@ static const char * const ts_symbol_names[] = { [aux_sym_connection_token2] = "connection_token2", [aux_sym_connection_token3] = "connection_token3", [aux_sym_connection_token4] = "connection_token4", + [aux_sym_connection_token5] = "connection_token5", [sym__ident_regex] = "_ident_regex", [sym__comment] = "_comment", [sym_source_file] = "source_file", @@ -83,8 +85,8 @@ static const TSSymbol ts_symbol_map[] = { [anon_sym_right] = anon_sym_right, [anon_sym_left] = anon_sym_left, [anon_sym_down] = anon_sym_down, - [anon_sym_SEMI] = anon_sym_SEMI, [aux_sym_expression_token1] = aux_sym_expression_token1, + [anon_sym_SEMI] = anon_sym_SEMI, [aux_sym_label_token1] = aux_sym_label_token1, [anon_sym_DASH] = anon_sym_DASH, [anon_sym_DOT] = anon_sym_DOT, @@ -92,6 +94,7 @@ static const TSSymbol ts_symbol_map[] = { [aux_sym_connection_token2] = aux_sym_connection_token2, [aux_sym_connection_token3] = aux_sym_connection_token3, [aux_sym_connection_token4] = aux_sym_connection_token4, + [aux_sym_connection_token5] = aux_sym_connection_token5, [sym__ident_regex] = sym__ident_regex, [sym__comment] = sym__comment, [sym_source_file] = sym_source_file, @@ -134,14 +137,14 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = false, }, - [anon_sym_SEMI] = { - .visible = true, - .named = false, - }, [aux_sym_expression_token1] = { .visible = false, .named = false, }, + [anon_sym_SEMI] = { + .visible = true, + .named = false, + }, [aux_sym_label_token1] = { .visible = false, .named = false, @@ -170,6 +173,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = false, .named = false, }, + [aux_sym_connection_token5] = { + .visible = false, + .named = false, + }, [sym__ident_regex] = { .visible = false, .named = true, @@ -242,6 +249,9 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [14] = 14, [15] = 15, [16] = 16, + [17] = 17, + [18] = 18, + [19] = 19, }; static inline bool sym__ident_regex_character_set_1(int32_t c) { @@ -1277,13 +1287,14 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { eof = lexer->eof(lexer); switch (state) { case 0: - if (eof) ADVANCE(26); + if (eof) ADVANCE(27); if (lookahead == '#') ADVANCE(1); if (lookahead == '-') ADVANCE(39); if (lookahead == '.') ADVANCE(40); - if (lookahead == ':') ADVANCE(28); - if (lookahead == ';') ADVANCE(33); + if (lookahead == ':') ADVANCE(29); + if (lookahead == ';') ADVANCE(35); if (lookahead == '<') ADVANCE(6); + if (lookahead == '\\') ADVANCE(2); if (lookahead == 'd') ADVANCE(13); if (lookahead == 'l') ADVANCE(8); if (lookahead == 'r') ADVANCE(14); @@ -1294,27 +1305,17 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead == ' ') SKIP(0) END_STATE(); case 1: - if (lookahead == '\n') ADVANCE(48); + if (lookahead == '\n') ADVANCE(50); if (lookahead != 0) ADVANCE(1); END_STATE(); case 2: - if (lookahead == '\n') ADVANCE(34); - if (lookahead == ' ') ADVANCE(45); - if (lookahead == '-') ADVANCE(39); - if (lookahead == '.') ADVANCE(40); - if (lookahead == ':') ADVANCE(28); - if (lookahead == ';') ADVANCE(33); - if (lookahead == '<') ADVANCE(6); - if (lookahead == '\t' || - lookahead == '\r') SKIP(2) - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(47); + if (lookahead == '\n') ADVANCE(3); END_STATE(); case 3: - if (lookahead == '\n') ADVANCE(35); - if (lookahead == ';') ADVANCE(33); + if (lookahead == '\n') ADVANCE(45); if (lookahead == '\t' || lookahead == '\r' || - lookahead == ' ') SKIP(3) + lookahead == ' ') ADVANCE(46); END_STATE(); case 4: if (lookahead == '\n') SKIP(4) @@ -1324,13 +1325,13 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead != 0) ADVANCE(37); END_STATE(); case 5: - if (lookahead == ' ') ADVANCE(46); + if (lookahead == ' ') ADVANCE(48); if (lookahead == '-') ADVANCE(38); if (lookahead == '.') ADVANCE(40); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r') SKIP(5) - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(47); + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(49); END_STATE(); case 6: if (lookahead == '-') ADVANCE(42); @@ -1364,25 +1365,25 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == 'i') ADVANCE(18); END_STATE(); case 16: - if (lookahead == 'n') ADVANCE(32); + if (lookahead == 'n') ADVANCE(33); END_STATE(); case 17: - if (lookahead == 'n') ADVANCE(27); + if (lookahead == 'n') ADVANCE(28); END_STATE(); case 18: if (lookahead == 'o') ADVANCE(17); END_STATE(); case 19: - if (lookahead == 'p') ADVANCE(29); + if (lookahead == 'p') ADVANCE(30); END_STATE(); case 20: if (lookahead == 'r') ADVANCE(9); END_STATE(); case 21: - if (lookahead == 't') ADVANCE(31); + if (lookahead == 't') ADVANCE(32); END_STATE(); case 22: - if (lookahead == 't') ADVANCE(30); + if (lookahead == 't') ADVANCE(31); END_STATE(); case 23: if (lookahead == 't') ADVANCE(15); @@ -1391,48 +1392,58 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == 'w') ADVANCE(16); END_STATE(); case 25: - if (eof) ADVANCE(26); - if (lookahead == ' ') ADVANCE(46); + if (eof) ADVANCE(27); + if (lookahead == '\n') ADVANCE(34); + if (lookahead == ' ') ADVANCE(47); if (lookahead == '-') ADVANCE(39); if (lookahead == '.') ADVANCE(40); + if (lookahead == ':') ADVANCE(29); + if (lookahead == ';') ADVANCE(35); if (lookahead == '<') ADVANCE(6); + if (lookahead == '\\') ADVANCE(2); if (lookahead == '\t' || - lookahead == '\n' || lookahead == '\r') SKIP(25) - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(47); + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(49); END_STATE(); case 26: - ACCEPT_TOKEN(ts_builtin_sym_end); + if (eof) ADVANCE(27); + if (lookahead == ' ') ADVANCE(48); + if (lookahead == '-') ADVANCE(39); + if (lookahead == '.') ADVANCE(40); + if (lookahead == '<') ADVANCE(6); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r') SKIP(26) + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(49); END_STATE(); case 27: - ACCEPT_TOKEN(anon_sym_direction); + ACCEPT_TOKEN(ts_builtin_sym_end); END_STATE(); case 28: - ACCEPT_TOKEN(anon_sym_COLON); + ACCEPT_TOKEN(anon_sym_direction); END_STATE(); case 29: - ACCEPT_TOKEN(anon_sym_up); + ACCEPT_TOKEN(anon_sym_COLON); END_STATE(); case 30: - ACCEPT_TOKEN(anon_sym_right); + ACCEPT_TOKEN(anon_sym_up); END_STATE(); case 31: - ACCEPT_TOKEN(anon_sym_left); + ACCEPT_TOKEN(anon_sym_right); END_STATE(); case 32: - ACCEPT_TOKEN(anon_sym_down); + ACCEPT_TOKEN(anon_sym_left); END_STATE(); case 33: - ACCEPT_TOKEN(anon_sym_SEMI); + ACCEPT_TOKEN(anon_sym_down); END_STATE(); case 34: ACCEPT_TOKEN(aux_sym_expression_token1); if (lookahead == '\n') ADVANCE(34); - if (lookahead == ' ') ADVANCE(45); + if (lookahead == ' ') ADVANCE(47); END_STATE(); case 35: - ACCEPT_TOKEN(aux_sym_expression_token1); - if (lookahead == '\n') ADVANCE(35); + ACCEPT_TOKEN(anon_sym_SEMI); END_STATE(); case 36: ACCEPT_TOKEN(aux_sym_label_token1); @@ -1475,21 +1486,35 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { ACCEPT_TOKEN(aux_sym_connection_token4); END_STATE(); case 45: - ACCEPT_TOKEN(sym__ident_regex); - if (lookahead == '\n') ADVANCE(34); - if (lookahead == ' ') ADVANCE(45); - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(47); + ACCEPT_TOKEN(aux_sym_connection_token5); + if (lookahead == '\n') ADVANCE(45); + if (lookahead == '\t' || + lookahead == '\r' || + lookahead == ' ') ADVANCE(46); END_STATE(); case 46: - ACCEPT_TOKEN(sym__ident_regex); - if (lookahead == ' ') ADVANCE(46); - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(47); + ACCEPT_TOKEN(aux_sym_connection_token5); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') ADVANCE(46); END_STATE(); case 47: ACCEPT_TOKEN(sym__ident_regex); - if (sym__ident_regex_character_set_2(lookahead)) ADVANCE(47); + if (lookahead == '\n') ADVANCE(34); + if (lookahead == ' ') ADVANCE(47); + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(49); END_STATE(); case 48: + ACCEPT_TOKEN(sym__ident_regex); + if (lookahead == ' ') ADVANCE(48); + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(49); + END_STATE(); + case 49: + ACCEPT_TOKEN(sym__ident_regex); + if (sym__ident_regex_character_set_2(lookahead)) ADVANCE(49); + END_STATE(); + case 50: ACCEPT_TOKEN(sym__comment); END_STATE(); default: @@ -1499,22 +1524,25 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { static const TSLexMode ts_lex_modes[STATE_COUNT] = { [0] = {.lex_state = 0}, - [1] = {.lex_state = 25}, - [2] = {.lex_state = 2}, + [1] = {.lex_state = 26}, + [2] = {.lex_state = 25}, [3] = {.lex_state = 25}, - [4] = {.lex_state = 25}, - [5] = {.lex_state = 2}, - [6] = {.lex_state = 2}, - [7] = {.lex_state = 2}, - [8] = {.lex_state = 2}, - [9] = {.lex_state = 2}, + [4] = {.lex_state = 26}, + [5] = {.lex_state = 26}, + [6] = {.lex_state = 25}, + [7] = {.lex_state = 25}, + [8] = {.lex_state = 25}, + [9] = {.lex_state = 25}, [10] = {.lex_state = 25}, [11] = {.lex_state = 25}, - [12] = {.lex_state = 5}, - [13] = {.lex_state = 3}, - [14] = {.lex_state = 3}, - [15] = {.lex_state = 0}, - [16] = {.lex_state = 4}, + [12] = {.lex_state = 25}, + [13] = {.lex_state = 25}, + [14] = {.lex_state = 26}, + [15] = {.lex_state = 26}, + [16] = {.lex_state = 5}, + [17] = {.lex_state = 0}, + [18] = {.lex_state = 0}, + [19] = {.lex_state = 4}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { @@ -1533,15 +1561,16 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [aux_sym_connection_token2] = ACTIONS(1), [aux_sym_connection_token3] = ACTIONS(1), [aux_sym_connection_token4] = ACTIONS(1), + [aux_sym_connection_token5] = ACTIONS(1), [sym__comment] = ACTIONS(1), }, [1] = { - [sym_source_file] = STATE(15), - [sym_expression] = STATE(3), + [sym_source_file] = STATE(18), + [sym_expression] = STATE(4), [sym_identifier] = STATE(2), [sym_sub_identifier] = STATE(6), [sym_connection] = STATE(2), - [aux_sym_source_file_repeat1] = STATE(3), + [aux_sym_source_file_repeat1] = STATE(4), [aux_sym_expression_repeat1] = STATE(2), [aux_sym_identifier_repeat1] = STATE(6), [ts_builtin_sym_end] = ACTIONS(3), @@ -1549,121 +1578,159 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_DOT] = ACTIONS(7), [aux_sym_connection_token1] = ACTIONS(9), [aux_sym_connection_token2] = ACTIONS(9), - [aux_sym_connection_token3] = ACTIONS(9), - [aux_sym_connection_token4] = ACTIONS(9), - [sym__ident_regex] = ACTIONS(11), + [aux_sym_connection_token3] = ACTIONS(11), + [aux_sym_connection_token4] = ACTIONS(11), + [sym__ident_regex] = ACTIONS(13), }, [2] = { - [sym_label] = STATE(13), - [sym_identifier] = STATE(5), + [sym_label] = STATE(12), + [sym_identifier] = STATE(3), [sym_sub_identifier] = STATE(6), - [sym_connection] = STATE(5), - [aux_sym_expression_repeat1] = STATE(5), + [sym_connection] = STATE(3), + [aux_sym_expression_repeat1] = STATE(3), [aux_sym_identifier_repeat1] = STATE(6), - [anon_sym_COLON] = ACTIONS(13), - [anon_sym_SEMI] = ACTIONS(15), - [aux_sym_expression_token1] = ACTIONS(15), + [ts_builtin_sym_end] = ACTIONS(15), + [anon_sym_COLON] = ACTIONS(17), + [aux_sym_expression_token1] = ACTIONS(19), + [anon_sym_SEMI] = ACTIONS(19), [anon_sym_DASH] = ACTIONS(5), [anon_sym_DOT] = ACTIONS(7), [aux_sym_connection_token1] = ACTIONS(9), [aux_sym_connection_token2] = ACTIONS(9), - [aux_sym_connection_token3] = ACTIONS(9), - [aux_sym_connection_token4] = ACTIONS(9), + [aux_sym_connection_token3] = ACTIONS(11), + [aux_sym_connection_token4] = ACTIONS(11), [sym__ident_regex] = ACTIONS(5), }, [3] = { - [sym_expression] = STATE(4), + [sym_identifier] = STATE(3), + [sym_sub_identifier] = STATE(6), + [sym_connection] = STATE(3), + [aux_sym_expression_repeat1] = STATE(3), + [aux_sym_identifier_repeat1] = STATE(6), + [ts_builtin_sym_end] = ACTIONS(21), + [anon_sym_COLON] = ACTIONS(23), + [aux_sym_expression_token1] = ACTIONS(23), + [anon_sym_SEMI] = ACTIONS(23), + [anon_sym_DASH] = ACTIONS(25), + [anon_sym_DOT] = ACTIONS(28), + [aux_sym_connection_token1] = ACTIONS(31), + [aux_sym_connection_token2] = ACTIONS(31), + [aux_sym_connection_token3] = ACTIONS(34), + [aux_sym_connection_token4] = ACTIONS(34), + [sym__ident_regex] = ACTIONS(25), + }, + [4] = { + [sym_expression] = STATE(5), [sym_identifier] = STATE(2), [sym_sub_identifier] = STATE(6), [sym_connection] = STATE(2), - [aux_sym_source_file_repeat1] = STATE(4), + [aux_sym_source_file_repeat1] = STATE(5), [aux_sym_expression_repeat1] = STATE(2), [aux_sym_identifier_repeat1] = STATE(6), - [ts_builtin_sym_end] = ACTIONS(17), + [ts_builtin_sym_end] = ACTIONS(37), [anon_sym_DASH] = ACTIONS(5), [anon_sym_DOT] = ACTIONS(7), [aux_sym_connection_token1] = ACTIONS(9), [aux_sym_connection_token2] = ACTIONS(9), - [aux_sym_connection_token3] = ACTIONS(9), - [aux_sym_connection_token4] = ACTIONS(9), - [sym__ident_regex] = ACTIONS(11), + [aux_sym_connection_token3] = ACTIONS(11), + [aux_sym_connection_token4] = ACTIONS(11), + [sym__ident_regex] = ACTIONS(13), }, - [4] = { - [sym_expression] = STATE(4), + [5] = { + [sym_expression] = STATE(5), [sym_identifier] = STATE(2), [sym_sub_identifier] = STATE(6), [sym_connection] = STATE(2), - [aux_sym_source_file_repeat1] = STATE(4), + [aux_sym_source_file_repeat1] = STATE(5), [aux_sym_expression_repeat1] = STATE(2), [aux_sym_identifier_repeat1] = STATE(6), - [ts_builtin_sym_end] = ACTIONS(19), - [anon_sym_DASH] = ACTIONS(21), - [anon_sym_DOT] = ACTIONS(24), - [aux_sym_connection_token1] = ACTIONS(27), - [aux_sym_connection_token2] = ACTIONS(27), - [aux_sym_connection_token3] = ACTIONS(27), - [aux_sym_connection_token4] = ACTIONS(27), - [sym__ident_regex] = ACTIONS(30), - }, - [5] = { - [sym_identifier] = STATE(5), - [sym_sub_identifier] = STATE(6), - [sym_connection] = STATE(5), - [aux_sym_expression_repeat1] = STATE(5), - [aux_sym_identifier_repeat1] = STATE(6), - [anon_sym_COLON] = ACTIONS(33), - [anon_sym_SEMI] = ACTIONS(33), - [aux_sym_expression_token1] = ACTIONS(33), - [anon_sym_DASH] = ACTIONS(35), - [anon_sym_DOT] = ACTIONS(38), - [aux_sym_connection_token1] = ACTIONS(41), - [aux_sym_connection_token2] = ACTIONS(41), - [aux_sym_connection_token3] = ACTIONS(41), - [aux_sym_connection_token4] = ACTIONS(41), - [sym__ident_regex] = ACTIONS(35), + [ts_builtin_sym_end] = ACTIONS(39), + [anon_sym_DASH] = ACTIONS(41), + [anon_sym_DOT] = ACTIONS(44), + [aux_sym_connection_token1] = ACTIONS(47), + [aux_sym_connection_token2] = ACTIONS(47), + [aux_sym_connection_token3] = ACTIONS(50), + [aux_sym_connection_token4] = ACTIONS(50), + [sym__ident_regex] = ACTIONS(53), }, }; static const uint16_t ts_small_parse_table[] = { - [0] = 4, + [0] = 5, ACTIONS(7), 1, anon_sym_DOT, - ACTIONS(46), 2, + ACTIONS(56), 1, + ts_builtin_sym_end, + ACTIONS(60), 2, anon_sym_DASH, sym__ident_regex, STATE(7), 2, sym_sub_identifier, aux_sym_identifier_repeat1, - ACTIONS(44), 7, + ACTIONS(58), 7, anon_sym_COLON, - anon_sym_SEMI, aux_sym_expression_token1, + anon_sym_SEMI, aux_sym_connection_token1, aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, - [21] = 4, - ACTIONS(53), 1, + [24] = 5, + ACTIONS(62), 1, + ts_builtin_sym_end, + ACTIONS(69), 1, anon_sym_DOT, - ACTIONS(50), 2, + ACTIONS(66), 2, anon_sym_DASH, sym__ident_regex, STATE(7), 2, sym_sub_identifier, aux_sym_identifier_repeat1, - ACTIONS(48), 7, + ACTIONS(64), 7, anon_sym_COLON, + aux_sym_expression_token1, anon_sym_SEMI, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + [48] = 3, + ACTIONS(72), 1, + ts_builtin_sym_end, + ACTIONS(76), 1, + aux_sym_connection_token5, + ACTIONS(74), 10, + anon_sym_COLON, aux_sym_expression_token1, + anon_sym_SEMI, + anon_sym_DASH, + anon_sym_DOT, aux_sym_connection_token1, aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, - [42] = 1, - ACTIONS(56), 10, + sym__ident_regex, + [67] = 2, + ACTIONS(72), 1, + ts_builtin_sym_end, + ACTIONS(74), 10, anon_sym_COLON, + aux_sym_expression_token1, anon_sym_SEMI, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [83] = 2, + ACTIONS(78), 1, + ts_builtin_sym_end, + ACTIONS(80), 10, + anon_sym_COLON, aux_sym_expression_token1, + anon_sym_SEMI, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, @@ -1671,11 +1738,27 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [55] = 1, - ACTIONS(58), 10, + [99] = 2, + ACTIONS(82), 1, + ts_builtin_sym_end, + ACTIONS(84), 10, anon_sym_COLON, + aux_sym_expression_token1, anon_sym_SEMI, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [115] = 3, + ACTIONS(86), 1, + ts_builtin_sym_end, + ACTIONS(88), 2, aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(90), 7, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, @@ -1683,70 +1766,81 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [68] = 2, - ACTIONS(60), 2, + [132] = 2, + ACTIONS(92), 1, + ts_builtin_sym_end, + ACTIONS(94), 9, + aux_sym_expression_token1, + anon_sym_SEMI, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [147] = 2, + ACTIONS(86), 2, ts_builtin_sym_end, sym__ident_regex, - ACTIONS(62), 6, + ACTIONS(90), 6, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, - [81] = 2, - ACTIONS(64), 2, + [160] = 2, + ACTIONS(96), 2, ts_builtin_sym_end, sym__ident_regex, - ACTIONS(66), 6, + ACTIONS(98), 6, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, - [94] = 5, + [173] = 5, ACTIONS(5), 1, anon_sym_DASH, ACTIONS(7), 1, anon_sym_DOT, - ACTIONS(11), 1, + ACTIONS(13), 1, sym__ident_regex, - STATE(9), 1, + STATE(10), 1, sym_identifier, STATE(6), 2, sym_sub_identifier, aux_sym_identifier_repeat1, - [111] = 2, - ACTIONS(68), 1, - anon_sym_SEMI, - ACTIONS(70), 1, - aux_sym_expression_token1, - [118] = 2, - ACTIONS(72), 1, - anon_sym_SEMI, - ACTIONS(74), 1, - aux_sym_expression_token1, - [125] = 1, - ACTIONS(76), 1, + [190] = 2, + ACTIONS(100), 1, + aux_sym_connection_token1, + ACTIONS(102), 1, + aux_sym_connection_token3, + [197] = 1, + ACTIONS(104), 1, ts_builtin_sym_end, - [129] = 1, - ACTIONS(78), 1, + [201] = 1, + ACTIONS(106), 1, aux_sym_label_token1, }; static const uint32_t ts_small_parse_table_map[] = { [SMALL_STATE(6)] = 0, - [SMALL_STATE(7)] = 21, - [SMALL_STATE(8)] = 42, - [SMALL_STATE(9)] = 55, - [SMALL_STATE(10)] = 68, - [SMALL_STATE(11)] = 81, - [SMALL_STATE(12)] = 94, - [SMALL_STATE(13)] = 111, - [SMALL_STATE(14)] = 118, - [SMALL_STATE(15)] = 125, - [SMALL_STATE(16)] = 129, + [SMALL_STATE(7)] = 24, + [SMALL_STATE(8)] = 48, + [SMALL_STATE(9)] = 67, + [SMALL_STATE(10)] = 83, + [SMALL_STATE(11)] = 99, + [SMALL_STATE(12)] = 115, + [SMALL_STATE(13)] = 132, + [SMALL_STATE(14)] = 147, + [SMALL_STATE(15)] = 160, + [SMALL_STATE(16)] = 173, + [SMALL_STATE(17)] = 190, + [SMALL_STATE(18)] = 197, + [SMALL_STATE(19)] = 201, }; static const TSParseActionEntry ts_parse_actions[] = { @@ -1754,38 +1848,51 @@ static const TSParseActionEntry ts_parse_actions[] = { [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), [3] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 0), [5] = {.entry = {.count = 1, .reusable = false}}, SHIFT(6), - [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(12), + [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(16), [9] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), - [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), - [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(16), - [15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10), - [17] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), - [19] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), - [21] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(6), - [24] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(12), - [27] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(8), - [30] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(6), - [33] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), - [35] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(6), - [38] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(12), - [41] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(8), - [44] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_identifier, 1), - [46] = {.entry = {.count = 1, .reusable = false}}, SHIFT(7), - [48] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), - [50] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(7), - [53] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(12), - [56] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_connection, 1), - [58] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sub_identifier, 2), - [60] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 2), - [62] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 2), - [64] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 3), - [66] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 3), - [68] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11), - [70] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), - [72] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_label, 2), - [74] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_label, 2), - [76] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), - [78] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), + [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9), + [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), + [15] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 1), + [17] = {.entry = {.count = 1, .reusable = false}}, SHIFT(19), + [19] = {.entry = {.count = 1, .reusable = false}}, SHIFT(14), + [21] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_expression_repeat1, 2), + [23] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), + [25] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(6), + [28] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(16), + [31] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(8), + [34] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(9), + [37] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), + [39] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), + [41] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(6), + [44] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(16), + [47] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(8), + [50] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(9), + [53] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(6), + [56] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_identifier, 1), + [58] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_identifier, 1), + [60] = {.entry = {.count = 1, .reusable = false}}, SHIFT(7), + [62] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_identifier_repeat1, 2), + [64] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), + [66] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(7), + [69] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(16), + [72] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_connection, 1), + [74] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_connection, 1), + [76] = {.entry = {.count = 1, .reusable = false}}, SHIFT(17), + [78] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sub_identifier, 2), + [80] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sub_identifier, 2), + [82] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_connection, 3), + [84] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_connection, 3), + [86] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 2), + [88] = {.entry = {.count = 1, .reusable = false}}, SHIFT(15), + [90] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 2), + [92] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_label, 2), + [94] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_label, 2), + [96] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 3), + [98] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 3), + [100] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11), + [102] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [104] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [106] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), }; #ifdef __cplusplus diff --git a/test/corpus/connections.txt b/test/corpus/connections.txt index 29f2f6c..17228df 100644 --- a/test/corpus/connections.txt +++ b/test/corpus/connections.txt @@ -86,4 +86,83 @@ Invalid connection "<>" (source_file (ERROR - (UNEXPECTED '>'))) \ No newline at end of file + (UNEXPECTED '>'))) + +==================||| +Basic +==================||| + +Write Replica Canada <-> Write Replica Australia + +Read Replica <- Master +Write Replica -> Master + +Read Replica 1 -- Read Replica 2 + +---||| + +(source_file + (expression + (identifier) + (connection) + (identifier)) + (expression + (identifier) + (connection) + (identifier)) + (expression + (identifier) + (connection) + (identifier)) + (expression + (identifier) + (connection) + (identifier))) + +==================||| +Connection labels +==================||| + +Read Replica 1 -- Read Replica 2: Kept in sync + +---||| + +(source_file + (expression + (identifier) + (connection) + (identifier) + (label))) + +==================||| +Multiline shape +==================||| + +a --\ + -- b +a <-\ + -- b +a --\ + -> b +a <-\ + -> b + +---||| + +(source_file + (expression + (identifier) + (connection) + (identifier)) + (expression + (identifier) + (connection) + (identifier)) + (expression + (identifier) + (connection) + (identifier)) + (expression + (identifier) + (connection) + (identifier))) \ No newline at end of file From 9d9fdcf4d0ccd54a95e60ed30b0abdc0faf0e7c9 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 27 Jul 2023 22:06:47 +0300 Subject: [PATCH 05/11] tests: add repeated connections --- test/corpus/connections.txt | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/test/corpus/connections.txt b/test/corpus/connections.txt index 17228df..93ff763 100644 --- a/test/corpus/connections.txt +++ b/test/corpus/connections.txt @@ -165,4 +165,30 @@ a <-\ (expression (identifier) (connection) - (identifier))) \ No newline at end of file + (identifier))) + +==================||| +Repeated Connections +==================||| + +Database -> S3: backup +Database -> S3 +Database -> S3: backup + +---||| + +(source_file + (expression + (identifier) + (connection) + (identifier) + (label)) + (expression + (identifier) + (connection) + (identifier)) + (expression + (identifier) + (connection) + (identifier) + (label))) From 881594ec740cb59c41ef7b4f15b71a18d40e2e43 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 27 Jul 2023 22:18:34 +0300 Subject: [PATCH 06/11] feat: add connections chaining --- .gitignore | 1 + grammar.js | 3 +- src/grammar.json | 10 +- src/parser.c | 261 +++++++++++++++++++----------------- test/corpus/connections.txt | 18 +++ 5 files changed, 167 insertions(+), 126 deletions(-) diff --git a/.gitignore b/.gitignore index 3c3629e..0ec4fe5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +test.d2 diff --git a/grammar.js b/grammar.js index 04f8d49..e72183b 100644 --- a/grammar.js +++ b/grammar.js @@ -5,6 +5,7 @@ module.exports = grammar({ source_file: $ => repeat(choice( // $.direction, $.expression, + $._comment, )), extras: $ => choice( @@ -84,7 +85,7 @@ module.exports = grammar({ _ident_regex: _ => /[\p{L}0-9_"' ]+/, - _comment: _ => token(seq('#', /.*/, /\n/)), + _comment: _ => token(seq('#', /.*\n/)), } }); diff --git a/src/grammar.json b/src/grammar.json index 1572ce6..db70fa1 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -9,6 +9,10 @@ { "type": "SYMBOL", "name": "expression" + }, + { + "type": "SYMBOL", + "name": "_comment" } ] } @@ -277,11 +281,7 @@ }, { "type": "PATTERN", - "value": ".*" - }, - { - "type": "PATTERN", - "value": "\\n" + "value": ".*\\n" } ] } diff --git a/src/parser.c b/src/parser.c index 22240a6..497a992 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1395,6 +1395,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (eof) ADVANCE(27); if (lookahead == '\n') ADVANCE(34); if (lookahead == ' ') ADVANCE(47); + if (lookahead == '#') ADVANCE(1); if (lookahead == '-') ADVANCE(39); if (lookahead == '.') ADVANCE(40); if (lookahead == ':') ADVANCE(29); @@ -1408,6 +1409,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { case 26: if (eof) ADVANCE(27); if (lookahead == ' ') ADVANCE(48); + if (lookahead == '#') ADVANCE(1); if (lookahead == '-') ADVANCE(39); if (lookahead == '.') ADVANCE(40); if (lookahead == '<') ADVANCE(6); @@ -1581,6 +1583,7 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [aux_sym_connection_token3] = ACTIONS(11), [aux_sym_connection_token4] = ACTIONS(11), [sym__ident_regex] = ACTIONS(13), + [sym__comment] = ACTIONS(15), }, [2] = { [sym_label] = STATE(12), @@ -1589,10 +1592,10 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [sym_connection] = STATE(3), [aux_sym_expression_repeat1] = STATE(3), [aux_sym_identifier_repeat1] = STATE(6), - [ts_builtin_sym_end] = ACTIONS(15), - [anon_sym_COLON] = ACTIONS(17), - [aux_sym_expression_token1] = ACTIONS(19), - [anon_sym_SEMI] = ACTIONS(19), + [ts_builtin_sym_end] = ACTIONS(17), + [anon_sym_COLON] = ACTIONS(19), + [aux_sym_expression_token1] = ACTIONS(21), + [anon_sym_SEMI] = ACTIONS(21), [anon_sym_DASH] = ACTIONS(5), [anon_sym_DOT] = ACTIONS(7), [aux_sym_connection_token1] = ACTIONS(9), @@ -1600,6 +1603,7 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [aux_sym_connection_token3] = ACTIONS(11), [aux_sym_connection_token4] = ACTIONS(11), [sym__ident_regex] = ACTIONS(5), + [sym__comment] = ACTIONS(23), }, [3] = { [sym_identifier] = STATE(3), @@ -1607,17 +1611,18 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [sym_connection] = STATE(3), [aux_sym_expression_repeat1] = STATE(3), [aux_sym_identifier_repeat1] = STATE(6), - [ts_builtin_sym_end] = ACTIONS(21), - [anon_sym_COLON] = ACTIONS(23), - [aux_sym_expression_token1] = ACTIONS(23), - [anon_sym_SEMI] = ACTIONS(23), - [anon_sym_DASH] = ACTIONS(25), - [anon_sym_DOT] = ACTIONS(28), - [aux_sym_connection_token1] = ACTIONS(31), - [aux_sym_connection_token2] = ACTIONS(31), - [aux_sym_connection_token3] = ACTIONS(34), - [aux_sym_connection_token4] = ACTIONS(34), - [sym__ident_regex] = ACTIONS(25), + [ts_builtin_sym_end] = ACTIONS(25), + [anon_sym_COLON] = ACTIONS(27), + [aux_sym_expression_token1] = ACTIONS(27), + [anon_sym_SEMI] = ACTIONS(27), + [anon_sym_DASH] = ACTIONS(29), + [anon_sym_DOT] = ACTIONS(32), + [aux_sym_connection_token1] = ACTIONS(35), + [aux_sym_connection_token2] = ACTIONS(35), + [aux_sym_connection_token3] = ACTIONS(38), + [aux_sym_connection_token4] = ACTIONS(38), + [sym__ident_regex] = ACTIONS(29), + [sym__comment] = ACTIONS(27), }, [4] = { [sym_expression] = STATE(5), @@ -1627,7 +1632,7 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [aux_sym_source_file_repeat1] = STATE(5), [aux_sym_expression_repeat1] = STATE(2), [aux_sym_identifier_repeat1] = STATE(6), - [ts_builtin_sym_end] = ACTIONS(37), + [ts_builtin_sym_end] = ACTIONS(41), [anon_sym_DASH] = ACTIONS(5), [anon_sym_DOT] = ACTIONS(7), [aux_sym_connection_token1] = ACTIONS(9), @@ -1635,6 +1640,7 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [aux_sym_connection_token3] = ACTIONS(11), [aux_sym_connection_token4] = ACTIONS(11), [sym__ident_regex] = ACTIONS(13), + [sym__comment] = ACTIONS(43), }, [5] = { [sym_expression] = STATE(5), @@ -1644,14 +1650,15 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [aux_sym_source_file_repeat1] = STATE(5), [aux_sym_expression_repeat1] = STATE(2), [aux_sym_identifier_repeat1] = STATE(6), - [ts_builtin_sym_end] = ACTIONS(39), - [anon_sym_DASH] = ACTIONS(41), - [anon_sym_DOT] = ACTIONS(44), - [aux_sym_connection_token1] = ACTIONS(47), - [aux_sym_connection_token2] = ACTIONS(47), - [aux_sym_connection_token3] = ACTIONS(50), - [aux_sym_connection_token4] = ACTIONS(50), - [sym__ident_regex] = ACTIONS(53), + [ts_builtin_sym_end] = ACTIONS(45), + [anon_sym_DASH] = ACTIONS(47), + [anon_sym_DOT] = ACTIONS(50), + [aux_sym_connection_token1] = ACTIONS(53), + [aux_sym_connection_token2] = ACTIONS(53), + [aux_sym_connection_token3] = ACTIONS(56), + [aux_sym_connection_token4] = ACTIONS(56), + [sym__ident_regex] = ACTIONS(59), + [sym__comment] = ACTIONS(62), }, }; @@ -1659,15 +1666,15 @@ static const uint16_t ts_small_parse_table[] = { [0] = 5, ACTIONS(7), 1, anon_sym_DOT, - ACTIONS(56), 1, + ACTIONS(65), 1, ts_builtin_sym_end, - ACTIONS(60), 2, + ACTIONS(69), 2, anon_sym_DASH, sym__ident_regex, STATE(7), 2, sym_sub_identifier, aux_sym_identifier_repeat1, - ACTIONS(58), 7, + ACTIONS(67), 8, anon_sym_COLON, aux_sym_expression_token1, anon_sym_SEMI, @@ -1675,18 +1682,19 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, - [24] = 5, - ACTIONS(62), 1, + sym__comment, + [25] = 5, + ACTIONS(71), 1, ts_builtin_sym_end, - ACTIONS(69), 1, + ACTIONS(78), 1, anon_sym_DOT, - ACTIONS(66), 2, + ACTIONS(75), 2, anon_sym_DASH, sym__ident_regex, STATE(7), 2, sym_sub_identifier, aux_sym_identifier_repeat1, - ACTIONS(64), 7, + ACTIONS(73), 8, anon_sym_COLON, aux_sym_expression_token1, anon_sym_SEMI, @@ -1694,12 +1702,13 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, - [48] = 3, - ACTIONS(72), 1, + sym__comment, + [50] = 3, + ACTIONS(81), 1, ts_builtin_sym_end, - ACTIONS(76), 1, + ACTIONS(85), 1, aux_sym_connection_token5, - ACTIONS(74), 10, + ACTIONS(83), 11, anon_sym_COLON, aux_sym_expression_token1, anon_sym_SEMI, @@ -1710,10 +1719,11 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [67] = 2, - ACTIONS(72), 1, + sym__comment, + [70] = 2, + ACTIONS(81), 1, ts_builtin_sym_end, - ACTIONS(74), 10, + ACTIONS(83), 11, anon_sym_COLON, aux_sym_expression_token1, anon_sym_SEMI, @@ -1724,10 +1734,11 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [83] = 2, - ACTIONS(78), 1, + sym__comment, + [87] = 2, + ACTIONS(87), 1, ts_builtin_sym_end, - ACTIONS(80), 10, + ACTIONS(89), 11, anon_sym_COLON, aux_sym_expression_token1, anon_sym_SEMI, @@ -1738,10 +1749,11 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [99] = 2, - ACTIONS(82), 1, + sym__comment, + [104] = 2, + ACTIONS(91), 1, ts_builtin_sym_end, - ACTIONS(84), 10, + ACTIONS(93), 11, anon_sym_COLON, aux_sym_expression_token1, anon_sym_SEMI, @@ -1752,13 +1764,14 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [115] = 3, - ACTIONS(86), 1, + sym__comment, + [121] = 3, + ACTIONS(95), 1, ts_builtin_sym_end, - ACTIONS(88), 2, + ACTIONS(97), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(90), 7, + ACTIONS(99), 8, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, @@ -1766,10 +1779,11 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [132] = 2, - ACTIONS(92), 1, + sym__comment, + [139] = 2, + ACTIONS(101), 1, ts_builtin_sym_end, - ACTIONS(94), 9, + ACTIONS(103), 10, aux_sym_expression_token1, anon_sym_SEMI, anon_sym_DASH, @@ -1779,29 +1793,32 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [147] = 2, - ACTIONS(86), 2, + sym__comment, + [155] = 2, + ACTIONS(95), 2, ts_builtin_sym_end, sym__ident_regex, - ACTIONS(90), 6, + ACTIONS(99), 7, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, - [160] = 2, - ACTIONS(96), 2, + sym__comment, + [169] = 2, + ACTIONS(105), 2, ts_builtin_sym_end, sym__ident_regex, - ACTIONS(98), 6, + ACTIONS(107), 7, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, - [173] = 5, + sym__comment, + [183] = 5, ACTIONS(5), 1, anon_sym_DASH, ACTIONS(7), 1, @@ -1813,34 +1830,34 @@ static const uint16_t ts_small_parse_table[] = { STATE(6), 2, sym_sub_identifier, aux_sym_identifier_repeat1, - [190] = 2, - ACTIONS(100), 1, + [200] = 2, + ACTIONS(109), 1, aux_sym_connection_token1, - ACTIONS(102), 1, + ACTIONS(111), 1, aux_sym_connection_token3, - [197] = 1, - ACTIONS(104), 1, + [207] = 1, + ACTIONS(113), 1, ts_builtin_sym_end, - [201] = 1, - ACTIONS(106), 1, + [211] = 1, + ACTIONS(115), 1, aux_sym_label_token1, }; static const uint32_t ts_small_parse_table_map[] = { [SMALL_STATE(6)] = 0, - [SMALL_STATE(7)] = 24, - [SMALL_STATE(8)] = 48, - [SMALL_STATE(9)] = 67, - [SMALL_STATE(10)] = 83, - [SMALL_STATE(11)] = 99, - [SMALL_STATE(12)] = 115, - [SMALL_STATE(13)] = 132, - [SMALL_STATE(14)] = 147, - [SMALL_STATE(15)] = 160, - [SMALL_STATE(16)] = 173, - [SMALL_STATE(17)] = 190, - [SMALL_STATE(18)] = 197, - [SMALL_STATE(19)] = 201, + [SMALL_STATE(7)] = 25, + [SMALL_STATE(8)] = 50, + [SMALL_STATE(9)] = 70, + [SMALL_STATE(10)] = 87, + [SMALL_STATE(11)] = 104, + [SMALL_STATE(12)] = 121, + [SMALL_STATE(13)] = 139, + [SMALL_STATE(14)] = 155, + [SMALL_STATE(15)] = 169, + [SMALL_STATE(16)] = 183, + [SMALL_STATE(17)] = 200, + [SMALL_STATE(18)] = 207, + [SMALL_STATE(19)] = 211, }; static const TSParseActionEntry ts_parse_actions[] = { @@ -1852,47 +1869,51 @@ static const TSParseActionEntry ts_parse_actions[] = { [9] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9), [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), - [15] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 1), - [17] = {.entry = {.count = 1, .reusable = false}}, SHIFT(19), - [19] = {.entry = {.count = 1, .reusable = false}}, SHIFT(14), - [21] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_expression_repeat1, 2), - [23] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), - [25] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(6), - [28] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(16), - [31] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(8), - [34] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(9), - [37] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), - [39] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), - [41] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(6), - [44] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(16), - [47] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(8), - [50] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(9), - [53] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(6), - [56] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_identifier, 1), - [58] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_identifier, 1), - [60] = {.entry = {.count = 1, .reusable = false}}, SHIFT(7), - [62] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_identifier_repeat1, 2), - [64] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), - [66] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(7), - [69] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(16), - [72] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_connection, 1), - [74] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_connection, 1), - [76] = {.entry = {.count = 1, .reusable = false}}, SHIFT(17), - [78] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sub_identifier, 2), - [80] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sub_identifier, 2), - [82] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_connection, 3), - [84] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_connection, 3), - [86] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 2), - [88] = {.entry = {.count = 1, .reusable = false}}, SHIFT(15), - [90] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 2), - [92] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_label, 2), - [94] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_label, 2), - [96] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 3), - [98] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 3), - [100] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11), - [102] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), - [104] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), - [106] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), + [15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(4), + [17] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 1), + [19] = {.entry = {.count = 1, .reusable = false}}, SHIFT(19), + [21] = {.entry = {.count = 1, .reusable = false}}, SHIFT(14), + [23] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 1), + [25] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_expression_repeat1, 2), + [27] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), + [29] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(6), + [32] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(16), + [35] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(8), + [38] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(9), + [41] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), + [43] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5), + [45] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), + [47] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(6), + [50] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(16), + [53] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(8), + [56] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(9), + [59] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(6), + [62] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(5), + [65] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_identifier, 1), + [67] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_identifier, 1), + [69] = {.entry = {.count = 1, .reusable = false}}, SHIFT(7), + [71] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_identifier_repeat1, 2), + [73] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), + [75] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(7), + [78] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(16), + [81] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_connection, 1), + [83] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_connection, 1), + [85] = {.entry = {.count = 1, .reusable = false}}, SHIFT(17), + [87] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sub_identifier, 2), + [89] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sub_identifier, 2), + [91] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_connection, 3), + [93] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_connection, 3), + [95] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 2), + [97] = {.entry = {.count = 1, .reusable = false}}, SHIFT(15), + [99] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 2), + [101] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_label, 2), + [103] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_label, 2), + [105] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 3), + [107] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 3), + [109] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11), + [111] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [113] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [115] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), }; #ifdef __cplusplus diff --git a/test/corpus/connections.txt b/test/corpus/connections.txt index 93ff763..84bdc43 100644 --- a/test/corpus/connections.txt +++ b/test/corpus/connections.txt @@ -192,3 +192,21 @@ Database -> S3: backup (connection) (identifier) (label))) + +==================||| +Connections Chaining +==================||| + +# The label applies to each connection in the chain. +High Mem Instance -> EC2 <- High CPU Instance: Hosted By + +---||| + +(source_file + (expression + (identifier) + (connection) + (identifier) + (connection) + (identifier) + (label))) \ No newline at end of file From 5acc0a2798f84ddd2226e8c7cd724c403252733f Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 27 Jul 2023 22:23:06 +0300 Subject: [PATCH 07/11] tests: add cycles --- test/corpus/connections.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/corpus/connections.txt b/test/corpus/connections.txt index 84bdc43..ab48cfb 100644 --- a/test/corpus/connections.txt +++ b/test/corpus/connections.txt @@ -206,6 +206,30 @@ High Mem Instance -> EC2 <- High CPU Instance: Hosted By (expression (identifier) (connection) + (identifier) + (connection) + (identifier) + (label))) + +==================||| +Cycles +==================||| + +Stage One -> Stage Two -> Stage Three -> Stage Four +Stage Four -> Stage One: repeat + +---||| + +(source_file + (expression + (identifier) + (connection) + (identifier) + (connection) + (identifier) + (connection) + (identifier)) + (expression (identifier) (connection) (identifier) From bf331ef17d5cde9a3b0bf199a5f5c722031e224d Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 27 Jul 2023 22:34:46 +0300 Subject: [PATCH 08/11] feat: add connection identifiers --- grammar.js | 10 + src/grammar.json | 49 ++ src/node-types.json | 20 + src/parser.c | 1070 ++++++++++++++++++++++++----------- test/corpus/connections.txt | 44 ++ 5 files changed, 866 insertions(+), 327 deletions(-) diff --git a/grammar.js b/grammar.js index e72183b..1e99466 100644 --- a/grammar.js +++ b/grammar.js @@ -21,14 +21,22 @@ module.exports = grammar({ )), expression: $ => prec.right(seq( + optional("("), repeat1(choice( $.identifier, $.connection, )), + optional(")"), + optional(seq( + $.connection_identifier, + $.sub_identifier + )), optional($.label), optional(choice(/\n+/, ";")), )), + + label: _ => seq(":", choice( // seq("|", /.+/, "|"), /.+/, @@ -79,6 +87,8 @@ module.exports = grammar({ seq(/<-+/, /\\\n+\s+/, /-+>/), ), + connection_identifier: _ => /\[\d+\]/, + // param_value: _ => /[\w\-_]+/i, // const-like rules diff --git a/src/grammar.json b/src/grammar.json index db70fa1..a37b7eb 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -70,6 +70,18 @@ "content": { "type": "SEQ", "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "(" + }, + { + "type": "BLANK" + } + ] + }, { "type": "REPEAT1", "content": { @@ -86,6 +98,39 @@ ] } }, + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": ")" + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "connection_identifier" + }, + { + "type": "SYMBOL", + "name": "sub_identifier" + } + ] + }, + { + "type": "BLANK" + } + ] + }, { "type": "CHOICE", "members": [ @@ -266,6 +311,10 @@ } ] }, + "connection_identifier": { + "type": "PATTERN", + "value": "\\[\\d+\\]" + }, "_ident_regex": { "type": "PATTERN", "value": "[\\p{L}0-9_\"' ]+" diff --git a/src/node-types.json b/src/node-types.json index 1d802c7..d60e304 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -16,6 +16,10 @@ "type": "connection", "named": true }, + { + "type": "connection_identifier", + "named": true + }, { "type": "identifier", "named": true @@ -23,6 +27,10 @@ { "type": "label", "named": true + }, + { + "type": "sub_identifier", + "named": true } ] } @@ -77,6 +85,14 @@ ] } }, + { + "type": "(", + "named": false + }, + { + "type": ")", + "named": false + }, { "type": "-", "named": false @@ -93,6 +109,10 @@ "type": ";", "named": false }, + { + "type": "connection_identifier", + "named": true + }, { "type": "direction", "named": false diff --git a/src/parser.c b/src/parser.c index 497a992..2eeb4ad 100644 --- a/src/parser.c +++ b/src/parser.c @@ -6,14 +6,14 @@ #endif #define LANGUAGE_VERSION 14 -#define STATE_COUNT 20 -#define LARGE_STATE_COUNT 6 -#define SYMBOL_COUNT 28 +#define STATE_COUNT 38 +#define LARGE_STATE_COUNT 10 +#define SYMBOL_COUNT 31 #define ALIAS_COUNT 0 -#define TOKEN_COUNT 19 +#define TOKEN_COUNT 22 #define EXTERNAL_TOKEN_COUNT 0 #define FIELD_COUNT 0 -#define MAX_ALIAS_SEQUENCE_LENGTH 3 +#define MAX_ALIAS_SEQUENCE_LENGTH 7 #define PRODUCTION_ID_COUNT 1 enum { @@ -23,27 +23,30 @@ enum { anon_sym_right = 4, anon_sym_left = 5, anon_sym_down = 6, - aux_sym_expression_token1 = 7, - anon_sym_SEMI = 8, - aux_sym_label_token1 = 9, - anon_sym_DASH = 10, - anon_sym_DOT = 11, - aux_sym_connection_token1 = 12, - aux_sym_connection_token2 = 13, - aux_sym_connection_token3 = 14, - aux_sym_connection_token4 = 15, - aux_sym_connection_token5 = 16, - sym__ident_regex = 17, - sym__comment = 18, - sym_source_file = 19, - sym_expression = 20, - sym_label = 21, - sym_identifier = 22, - sym_sub_identifier = 23, - sym_connection = 24, - aux_sym_source_file_repeat1 = 25, - aux_sym_expression_repeat1 = 26, - aux_sym_identifier_repeat1 = 27, + anon_sym_LPAREN = 7, + anon_sym_RPAREN = 8, + aux_sym_expression_token1 = 9, + anon_sym_SEMI = 10, + aux_sym_label_token1 = 11, + anon_sym_DASH = 12, + anon_sym_DOT = 13, + aux_sym_connection_token1 = 14, + aux_sym_connection_token2 = 15, + aux_sym_connection_token3 = 16, + aux_sym_connection_token4 = 17, + aux_sym_connection_token5 = 18, + sym_connection_identifier = 19, + sym__ident_regex = 20, + sym__comment = 21, + sym_source_file = 22, + sym_expression = 23, + sym_label = 24, + sym_identifier = 25, + sym_sub_identifier = 26, + sym_connection = 27, + aux_sym_source_file_repeat1 = 28, + aux_sym_expression_repeat1 = 29, + aux_sym_identifier_repeat1 = 30, }; static const char * const ts_symbol_names[] = { @@ -54,6 +57,8 @@ static const char * const ts_symbol_names[] = { [anon_sym_right] = "right", [anon_sym_left] = "left", [anon_sym_down] = "down", + [anon_sym_LPAREN] = "(", + [anon_sym_RPAREN] = ")", [aux_sym_expression_token1] = "expression_token1", [anon_sym_SEMI] = ";", [aux_sym_label_token1] = "label_token1", @@ -64,6 +69,7 @@ static const char * const ts_symbol_names[] = { [aux_sym_connection_token3] = "connection_token3", [aux_sym_connection_token4] = "connection_token4", [aux_sym_connection_token5] = "connection_token5", + [sym_connection_identifier] = "connection_identifier", [sym__ident_regex] = "_ident_regex", [sym__comment] = "_comment", [sym_source_file] = "source_file", @@ -85,6 +91,8 @@ static const TSSymbol ts_symbol_map[] = { [anon_sym_right] = anon_sym_right, [anon_sym_left] = anon_sym_left, [anon_sym_down] = anon_sym_down, + [anon_sym_LPAREN] = anon_sym_LPAREN, + [anon_sym_RPAREN] = anon_sym_RPAREN, [aux_sym_expression_token1] = aux_sym_expression_token1, [anon_sym_SEMI] = anon_sym_SEMI, [aux_sym_label_token1] = aux_sym_label_token1, @@ -95,6 +103,7 @@ static const TSSymbol ts_symbol_map[] = { [aux_sym_connection_token3] = aux_sym_connection_token3, [aux_sym_connection_token4] = aux_sym_connection_token4, [aux_sym_connection_token5] = aux_sym_connection_token5, + [sym_connection_identifier] = sym_connection_identifier, [sym__ident_regex] = sym__ident_regex, [sym__comment] = sym__comment, [sym_source_file] = sym_source_file, @@ -137,6 +146,14 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = false, }, + [anon_sym_LPAREN] = { + .visible = true, + .named = false, + }, + [anon_sym_RPAREN] = { + .visible = true, + .named = false, + }, [aux_sym_expression_token1] = { .visible = false, .named = false, @@ -177,6 +194,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = false, .named = false, }, + [sym_connection_identifier] = { + .visible = true, + .named = true, + }, [sym__ident_regex] = { .visible = false, .named = true, @@ -252,6 +273,24 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [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, }; static inline bool sym__ident_regex_character_set_1(int32_t c) { @@ -1287,236 +1326,259 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { eof = lexer->eof(lexer); switch (state) { case 0: - if (eof) ADVANCE(27); + if (eof) ADVANCE(29); if (lookahead == '#') ADVANCE(1); - if (lookahead == '-') ADVANCE(39); - if (lookahead == '.') ADVANCE(40); - if (lookahead == ':') ADVANCE(29); - if (lookahead == ';') ADVANCE(35); + if (lookahead == '(') ADVANCE(36); + if (lookahead == ')') ADVANCE(37); + if (lookahead == '-') ADVANCE(43); + if (lookahead == '.') ADVANCE(44); + if (lookahead == ':') ADVANCE(31); + if (lookahead == ';') ADVANCE(39); if (lookahead == '<') ADVANCE(6); + if (lookahead == '[') ADVANCE(26); if (lookahead == '\\') ADVANCE(2); - if (lookahead == 'd') ADVANCE(13); - if (lookahead == 'l') ADVANCE(8); - if (lookahead == 'r') ADVANCE(14); - if (lookahead == 'u') ADVANCE(19); + if (lookahead == 'd') ADVANCE(14); + if (lookahead == 'l') ADVANCE(9); + if (lookahead == 'r') ADVANCE(15); + if (lookahead == 'u') ADVANCE(20); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') SKIP(0) END_STATE(); case 1: - if (lookahead == '\n') ADVANCE(50); + if (lookahead == '\n') ADVANCE(55); if (lookahead != 0) ADVANCE(1); END_STATE(); case 2: if (lookahead == '\n') ADVANCE(3); END_STATE(); case 3: - if (lookahead == '\n') ADVANCE(45); + if (lookahead == '\n') ADVANCE(49); if (lookahead == '\t' || lookahead == '\r' || - lookahead == ' ') ADVANCE(46); + lookahead == ' ') ADVANCE(50); END_STATE(); case 4: if (lookahead == '\n') SKIP(4) if (lookahead == '\t' || lookahead == '\r' || - lookahead == ' ') ADVANCE(36); - if (lookahead != 0) ADVANCE(37); + lookahead == ' ') ADVANCE(40); + if (lookahead != 0) ADVANCE(41); END_STATE(); case 5: - if (lookahead == ' ') ADVANCE(48); - if (lookahead == '-') ADVANCE(38); - if (lookahead == '.') ADVANCE(40); + if (lookahead == ' ') ADVANCE(53); + if (lookahead == '-') ADVANCE(42); + if (lookahead == '.') ADVANCE(44); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r') SKIP(5) - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(49); + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(54); END_STATE(); case 6: - if (lookahead == '-') ADVANCE(42); + if (lookahead == '-') ADVANCE(46); END_STATE(); case 7: - if (lookahead == 'c') ADVANCE(23); + if (lookahead == ']') ADVANCE(51); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(7); END_STATE(); case 8: - if (lookahead == 'e') ADVANCE(10); + if (lookahead == 'c') ADVANCE(24); END_STATE(); case 9: - if (lookahead == 'e') ADVANCE(7); + if (lookahead == 'e') ADVANCE(11); END_STATE(); case 10: - if (lookahead == 'f') ADVANCE(21); + if (lookahead == 'e') ADVANCE(8); END_STATE(); case 11: - if (lookahead == 'g') ADVANCE(12); + if (lookahead == 'f') ADVANCE(22); END_STATE(); case 12: - if (lookahead == 'h') ADVANCE(22); + if (lookahead == 'g') ADVANCE(13); END_STATE(); case 13: - if (lookahead == 'i') ADVANCE(20); - if (lookahead == 'o') ADVANCE(24); + if (lookahead == 'h') ADVANCE(23); END_STATE(); case 14: - if (lookahead == 'i') ADVANCE(11); + if (lookahead == 'i') ADVANCE(21); + if (lookahead == 'o') ADVANCE(25); END_STATE(); case 15: - if (lookahead == 'i') ADVANCE(18); + if (lookahead == 'i') ADVANCE(12); END_STATE(); case 16: - if (lookahead == 'n') ADVANCE(33); + if (lookahead == 'i') ADVANCE(19); END_STATE(); case 17: - if (lookahead == 'n') ADVANCE(28); + if (lookahead == 'n') ADVANCE(35); END_STATE(); case 18: - if (lookahead == 'o') ADVANCE(17); + if (lookahead == 'n') ADVANCE(30); END_STATE(); case 19: - if (lookahead == 'p') ADVANCE(30); + if (lookahead == 'o') ADVANCE(18); END_STATE(); case 20: - if (lookahead == 'r') ADVANCE(9); + if (lookahead == 'p') ADVANCE(32); END_STATE(); case 21: - if (lookahead == 't') ADVANCE(32); + if (lookahead == 'r') ADVANCE(10); END_STATE(); case 22: - if (lookahead == 't') ADVANCE(31); + if (lookahead == 't') ADVANCE(34); END_STATE(); case 23: - if (lookahead == 't') ADVANCE(15); + if (lookahead == 't') ADVANCE(33); END_STATE(); case 24: - if (lookahead == 'w') ADVANCE(16); + if (lookahead == 't') ADVANCE(16); END_STATE(); case 25: - if (eof) ADVANCE(27); - if (lookahead == '\n') ADVANCE(34); - if (lookahead == ' ') ADVANCE(47); + if (lookahead == 'w') ADVANCE(17); + END_STATE(); + case 26: + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(7); + END_STATE(); + case 27: + if (eof) ADVANCE(29); + if (lookahead == '\n') ADVANCE(38); + if (lookahead == ' ') ADVANCE(52); if (lookahead == '#') ADVANCE(1); - if (lookahead == '-') ADVANCE(39); - if (lookahead == '.') ADVANCE(40); - if (lookahead == ':') ADVANCE(29); - if (lookahead == ';') ADVANCE(35); + if (lookahead == '(') ADVANCE(36); + if (lookahead == ')') ADVANCE(37); + if (lookahead == '-') ADVANCE(43); + if (lookahead == '.') ADVANCE(44); + if (lookahead == ':') ADVANCE(31); + if (lookahead == ';') ADVANCE(39); if (lookahead == '<') ADVANCE(6); + if (lookahead == '[') ADVANCE(26); if (lookahead == '\\') ADVANCE(2); if (lookahead == '\t' || - lookahead == '\r') SKIP(25) - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(49); + lookahead == '\r') SKIP(27) + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(54); END_STATE(); - case 26: - if (eof) ADVANCE(27); - if (lookahead == ' ') ADVANCE(48); + case 28: + if (eof) ADVANCE(29); + if (lookahead == ' ') ADVANCE(53); if (lookahead == '#') ADVANCE(1); - if (lookahead == '-') ADVANCE(39); - if (lookahead == '.') ADVANCE(40); + if (lookahead == '(') ADVANCE(36); + if (lookahead == '-') ADVANCE(43); + if (lookahead == '.') ADVANCE(44); if (lookahead == '<') ADVANCE(6); if (lookahead == '\t' || lookahead == '\n' || - lookahead == '\r') SKIP(26) - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(49); + lookahead == '\r') SKIP(28) + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(54); END_STATE(); - case 27: + case 29: ACCEPT_TOKEN(ts_builtin_sym_end); END_STATE(); - case 28: + case 30: ACCEPT_TOKEN(anon_sym_direction); END_STATE(); - case 29: + case 31: ACCEPT_TOKEN(anon_sym_COLON); END_STATE(); - case 30: + case 32: ACCEPT_TOKEN(anon_sym_up); END_STATE(); - case 31: + case 33: ACCEPT_TOKEN(anon_sym_right); END_STATE(); - case 32: + case 34: ACCEPT_TOKEN(anon_sym_left); END_STATE(); - case 33: + case 35: ACCEPT_TOKEN(anon_sym_down); END_STATE(); - case 34: + case 36: + ACCEPT_TOKEN(anon_sym_LPAREN); + END_STATE(); + case 37: + ACCEPT_TOKEN(anon_sym_RPAREN); + END_STATE(); + case 38: ACCEPT_TOKEN(aux_sym_expression_token1); - if (lookahead == '\n') ADVANCE(34); - if (lookahead == ' ') ADVANCE(47); + if (lookahead == '\n') ADVANCE(38); + if (lookahead == ' ') ADVANCE(52); END_STATE(); - case 35: + case 39: ACCEPT_TOKEN(anon_sym_SEMI); END_STATE(); - case 36: + case 40: ACCEPT_TOKEN(aux_sym_label_token1); if (lookahead == '\t' || lookahead == '\r' || - lookahead == ' ') ADVANCE(36); + lookahead == ' ') ADVANCE(40); if (lookahead != 0 && - lookahead != '\n') ADVANCE(37); + lookahead != '\n') ADVANCE(41); END_STATE(); - case 37: + case 41: ACCEPT_TOKEN(aux_sym_label_token1); if (lookahead != 0 && - lookahead != '\n') ADVANCE(37); + lookahead != '\n') ADVANCE(41); END_STATE(); - case 38: + case 42: ACCEPT_TOKEN(anon_sym_DASH); END_STATE(); - case 39: + case 43: ACCEPT_TOKEN(anon_sym_DASH); - if (lookahead == '-') ADVANCE(41); - if (lookahead == '>') ADVANCE(43); + if (lookahead == '-') ADVANCE(45); + if (lookahead == '>') ADVANCE(47); END_STATE(); - case 40: + case 44: ACCEPT_TOKEN(anon_sym_DOT); END_STATE(); - case 41: + case 45: ACCEPT_TOKEN(aux_sym_connection_token1); - if (lookahead == '-') ADVANCE(41); - if (lookahead == '>') ADVANCE(43); + if (lookahead == '-') ADVANCE(45); + if (lookahead == '>') ADVANCE(47); END_STATE(); - case 42: + case 46: ACCEPT_TOKEN(aux_sym_connection_token2); - if (lookahead == '-') ADVANCE(42); - if (lookahead == '>') ADVANCE(44); + if (lookahead == '-') ADVANCE(46); + if (lookahead == '>') ADVANCE(48); END_STATE(); - case 43: + case 47: ACCEPT_TOKEN(aux_sym_connection_token3); END_STATE(); - case 44: + case 48: ACCEPT_TOKEN(aux_sym_connection_token4); END_STATE(); - case 45: + case 49: ACCEPT_TOKEN(aux_sym_connection_token5); - if (lookahead == '\n') ADVANCE(45); + if (lookahead == '\n') ADVANCE(49); if (lookahead == '\t' || lookahead == '\r' || - lookahead == ' ') ADVANCE(46); + lookahead == ' ') ADVANCE(50); END_STATE(); - case 46: + case 50: ACCEPT_TOKEN(aux_sym_connection_token5); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || - lookahead == ' ') ADVANCE(46); + lookahead == ' ') ADVANCE(50); END_STATE(); - case 47: + case 51: + ACCEPT_TOKEN(sym_connection_identifier); + END_STATE(); + case 52: ACCEPT_TOKEN(sym__ident_regex); - if (lookahead == '\n') ADVANCE(34); - if (lookahead == ' ') ADVANCE(47); - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(49); + if (lookahead == '\n') ADVANCE(38); + if (lookahead == ' ') ADVANCE(52); + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(54); END_STATE(); - case 48: + case 53: ACCEPT_TOKEN(sym__ident_regex); - if (lookahead == ' ') ADVANCE(48); - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(49); + if (lookahead == ' ') ADVANCE(53); + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(54); END_STATE(); - case 49: + case 54: ACCEPT_TOKEN(sym__ident_regex); - if (sym__ident_regex_character_set_2(lookahead)) ADVANCE(49); + if (sym__ident_regex_character_set_2(lookahead)) ADVANCE(54); END_STATE(); - case 50: + case 55: ACCEPT_TOKEN(sym__comment); END_STATE(); default: @@ -1526,25 +1588,43 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { static const TSLexMode ts_lex_modes[STATE_COUNT] = { [0] = {.lex_state = 0}, - [1] = {.lex_state = 26}, - [2] = {.lex_state = 25}, - [3] = {.lex_state = 25}, - [4] = {.lex_state = 26}, - [5] = {.lex_state = 26}, - [6] = {.lex_state = 25}, - [7] = {.lex_state = 25}, - [8] = {.lex_state = 25}, - [9] = {.lex_state = 25}, - [10] = {.lex_state = 25}, - [11] = {.lex_state = 25}, - [12] = {.lex_state = 25}, - [13] = {.lex_state = 25}, - [14] = {.lex_state = 26}, - [15] = {.lex_state = 26}, - [16] = {.lex_state = 5}, - [17] = {.lex_state = 0}, - [18] = {.lex_state = 0}, - [19] = {.lex_state = 4}, + [1] = {.lex_state = 28}, + [2] = {.lex_state = 27}, + [3] = {.lex_state = 27}, + [4] = {.lex_state = 27}, + [5] = {.lex_state = 28}, + [6] = {.lex_state = 27}, + [7] = {.lex_state = 27}, + [8] = {.lex_state = 28}, + [9] = {.lex_state = 27}, + [10] = {.lex_state = 27}, + [11] = {.lex_state = 27}, + [12] = {.lex_state = 27}, + [13] = {.lex_state = 27}, + [14] = {.lex_state = 27}, + [15] = {.lex_state = 27}, + [16] = {.lex_state = 27}, + [17] = {.lex_state = 27}, + [18] = {.lex_state = 27}, + [19] = {.lex_state = 28}, + [20] = {.lex_state = 27}, + [21] = {.lex_state = 27}, + [22] = {.lex_state = 27}, + [23] = {.lex_state = 27}, + [24] = {.lex_state = 27}, + [25] = {.lex_state = 28}, + [26] = {.lex_state = 28}, + [27] = {.lex_state = 28}, + [28] = {.lex_state = 28}, + [29] = {.lex_state = 28}, + [30] = {.lex_state = 28}, + [31] = {.lex_state = 5}, + [32] = {.lex_state = 0}, + [33] = {.lex_state = 0}, + [34] = {.lex_state = 0}, + [35] = {.lex_state = 0}, + [36] = {.lex_state = 4}, + [37] = {.lex_state = 0}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { @@ -1556,6 +1636,8 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_right] = ACTIONS(1), [anon_sym_left] = ACTIONS(1), [anon_sym_down] = ACTIONS(1), + [anon_sym_LPAREN] = ACTIONS(1), + [anon_sym_RPAREN] = ACTIONS(1), [anon_sym_SEMI] = ACTIONS(1), [anon_sym_DASH] = ACTIONS(1), [anon_sym_DOT] = ACTIONS(1), @@ -1564,154 +1646,344 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [aux_sym_connection_token3] = ACTIONS(1), [aux_sym_connection_token4] = ACTIONS(1), [aux_sym_connection_token5] = ACTIONS(1), + [sym_connection_identifier] = ACTIONS(1), [sym__comment] = ACTIONS(1), }, [1] = { - [sym_source_file] = STATE(18), - [sym_expression] = STATE(4), + [sym_source_file] = STATE(37), + [sym_expression] = STATE(5), [sym_identifier] = STATE(2), [sym_sub_identifier] = STATE(6), [sym_connection] = STATE(2), - [aux_sym_source_file_repeat1] = STATE(4), + [aux_sym_source_file_repeat1] = STATE(5), [aux_sym_expression_repeat1] = STATE(2), [aux_sym_identifier_repeat1] = STATE(6), [ts_builtin_sym_end] = ACTIONS(3), - [anon_sym_DASH] = ACTIONS(5), - [anon_sym_DOT] = ACTIONS(7), - [aux_sym_connection_token1] = ACTIONS(9), - [aux_sym_connection_token2] = ACTIONS(9), - [aux_sym_connection_token3] = ACTIONS(11), - [aux_sym_connection_token4] = ACTIONS(11), - [sym__ident_regex] = ACTIONS(13), - [sym__comment] = ACTIONS(15), + [anon_sym_LPAREN] = ACTIONS(5), + [anon_sym_DASH] = ACTIONS(7), + [anon_sym_DOT] = ACTIONS(9), + [aux_sym_connection_token1] = ACTIONS(11), + [aux_sym_connection_token2] = ACTIONS(11), + [aux_sym_connection_token3] = ACTIONS(13), + [aux_sym_connection_token4] = ACTIONS(13), + [sym__ident_regex] = ACTIONS(15), + [sym__comment] = ACTIONS(17), }, [2] = { - [sym_label] = STATE(12), - [sym_identifier] = STATE(3), + [sym_label] = STATE(22), + [sym_identifier] = STATE(4), [sym_sub_identifier] = STATE(6), - [sym_connection] = STATE(3), - [aux_sym_expression_repeat1] = STATE(3), + [sym_connection] = STATE(4), + [aux_sym_expression_repeat1] = STATE(4), [aux_sym_identifier_repeat1] = STATE(6), - [ts_builtin_sym_end] = ACTIONS(17), - [anon_sym_COLON] = ACTIONS(19), - [aux_sym_expression_token1] = ACTIONS(21), - [anon_sym_SEMI] = ACTIONS(21), - [anon_sym_DASH] = ACTIONS(5), - [anon_sym_DOT] = ACTIONS(7), - [aux_sym_connection_token1] = ACTIONS(9), - [aux_sym_connection_token2] = ACTIONS(9), - [aux_sym_connection_token3] = ACTIONS(11), - [aux_sym_connection_token4] = ACTIONS(11), - [sym__ident_regex] = ACTIONS(5), + [ts_builtin_sym_end] = ACTIONS(19), + [anon_sym_COLON] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_RPAREN] = ACTIONS(25), + [aux_sym_expression_token1] = ACTIONS(27), + [anon_sym_SEMI] = ACTIONS(27), + [anon_sym_DASH] = ACTIONS(7), + [anon_sym_DOT] = ACTIONS(9), + [aux_sym_connection_token1] = ACTIONS(11), + [aux_sym_connection_token2] = ACTIONS(11), + [aux_sym_connection_token3] = ACTIONS(13), + [aux_sym_connection_token4] = ACTIONS(13), + [sym_connection_identifier] = ACTIONS(29), + [sym__ident_regex] = ACTIONS(7), [sym__comment] = ACTIONS(23), }, [3] = { - [sym_identifier] = STATE(3), + [sym_label] = STATE(20), + [sym_identifier] = STATE(4), [sym_sub_identifier] = STATE(6), - [sym_connection] = STATE(3), - [aux_sym_expression_repeat1] = STATE(3), + [sym_connection] = STATE(4), + [aux_sym_expression_repeat1] = STATE(4), [aux_sym_identifier_repeat1] = STATE(6), - [ts_builtin_sym_end] = ACTIONS(25), - [anon_sym_COLON] = ACTIONS(27), - [aux_sym_expression_token1] = ACTIONS(27), - [anon_sym_SEMI] = ACTIONS(27), - [anon_sym_DASH] = ACTIONS(29), - [anon_sym_DOT] = ACTIONS(32), - [aux_sym_connection_token1] = ACTIONS(35), - [aux_sym_connection_token2] = ACTIONS(35), - [aux_sym_connection_token3] = ACTIONS(38), - [aux_sym_connection_token4] = ACTIONS(38), - [sym__ident_regex] = ACTIONS(29), - [sym__comment] = ACTIONS(27), + [ts_builtin_sym_end] = ACTIONS(31), + [anon_sym_COLON] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(33), + [anon_sym_RPAREN] = ACTIONS(35), + [aux_sym_expression_token1] = ACTIONS(37), + [anon_sym_SEMI] = ACTIONS(37), + [anon_sym_DASH] = ACTIONS(7), + [anon_sym_DOT] = ACTIONS(9), + [aux_sym_connection_token1] = ACTIONS(11), + [aux_sym_connection_token2] = ACTIONS(11), + [aux_sym_connection_token3] = ACTIONS(13), + [aux_sym_connection_token4] = ACTIONS(13), + [sym_connection_identifier] = ACTIONS(39), + [sym__ident_regex] = ACTIONS(7), + [sym__comment] = ACTIONS(33), }, [4] = { - [sym_expression] = STATE(5), - [sym_identifier] = STATE(2), + [sym_identifier] = STATE(4), [sym_sub_identifier] = STATE(6), - [sym_connection] = STATE(2), - [aux_sym_source_file_repeat1] = STATE(5), - [aux_sym_expression_repeat1] = STATE(2), + [sym_connection] = STATE(4), + [aux_sym_expression_repeat1] = STATE(4), [aux_sym_identifier_repeat1] = STATE(6), [ts_builtin_sym_end] = ACTIONS(41), - [anon_sym_DASH] = ACTIONS(5), - [anon_sym_DOT] = ACTIONS(7), - [aux_sym_connection_token1] = ACTIONS(9), - [aux_sym_connection_token2] = ACTIONS(9), - [aux_sym_connection_token3] = ACTIONS(11), - [aux_sym_connection_token4] = ACTIONS(11), - [sym__ident_regex] = ACTIONS(13), + [anon_sym_COLON] = ACTIONS(43), + [anon_sym_LPAREN] = ACTIONS(43), + [anon_sym_RPAREN] = ACTIONS(43), + [aux_sym_expression_token1] = ACTIONS(43), + [anon_sym_SEMI] = ACTIONS(43), + [anon_sym_DASH] = ACTIONS(45), + [anon_sym_DOT] = ACTIONS(48), + [aux_sym_connection_token1] = ACTIONS(51), + [aux_sym_connection_token2] = ACTIONS(51), + [aux_sym_connection_token3] = ACTIONS(54), + [aux_sym_connection_token4] = ACTIONS(54), + [sym_connection_identifier] = ACTIONS(43), + [sym__ident_regex] = ACTIONS(45), [sym__comment] = ACTIONS(43), }, [5] = { - [sym_expression] = STATE(5), + [sym_expression] = STATE(8), [sym_identifier] = STATE(2), [sym_sub_identifier] = STATE(6), [sym_connection] = STATE(2), - [aux_sym_source_file_repeat1] = STATE(5), + [aux_sym_source_file_repeat1] = STATE(8), + [aux_sym_expression_repeat1] = STATE(2), + [aux_sym_identifier_repeat1] = STATE(6), + [ts_builtin_sym_end] = ACTIONS(57), + [anon_sym_LPAREN] = ACTIONS(5), + [anon_sym_DASH] = ACTIONS(7), + [anon_sym_DOT] = ACTIONS(9), + [aux_sym_connection_token1] = ACTIONS(11), + [aux_sym_connection_token2] = ACTIONS(11), + [aux_sym_connection_token3] = ACTIONS(13), + [aux_sym_connection_token4] = ACTIONS(13), + [sym__ident_regex] = ACTIONS(15), + [sym__comment] = ACTIONS(59), + }, + [6] = { + [sym_sub_identifier] = STATE(7), + [aux_sym_identifier_repeat1] = STATE(7), + [ts_builtin_sym_end] = ACTIONS(61), + [anon_sym_COLON] = ACTIONS(63), + [anon_sym_LPAREN] = ACTIONS(63), + [anon_sym_RPAREN] = ACTIONS(63), + [aux_sym_expression_token1] = ACTIONS(63), + [anon_sym_SEMI] = ACTIONS(63), + [anon_sym_DASH] = ACTIONS(65), + [anon_sym_DOT] = ACTIONS(9), + [aux_sym_connection_token1] = ACTIONS(63), + [aux_sym_connection_token2] = ACTIONS(63), + [aux_sym_connection_token3] = ACTIONS(63), + [aux_sym_connection_token4] = ACTIONS(63), + [sym_connection_identifier] = ACTIONS(63), + [sym__ident_regex] = ACTIONS(65), + [sym__comment] = ACTIONS(63), + }, + [7] = { + [sym_sub_identifier] = STATE(7), + [aux_sym_identifier_repeat1] = STATE(7), + [ts_builtin_sym_end] = ACTIONS(67), + [anon_sym_COLON] = ACTIONS(69), + [anon_sym_LPAREN] = ACTIONS(69), + [anon_sym_RPAREN] = ACTIONS(69), + [aux_sym_expression_token1] = ACTIONS(69), + [anon_sym_SEMI] = ACTIONS(69), + [anon_sym_DASH] = ACTIONS(71), + [anon_sym_DOT] = ACTIONS(74), + [aux_sym_connection_token1] = ACTIONS(69), + [aux_sym_connection_token2] = ACTIONS(69), + [aux_sym_connection_token3] = ACTIONS(69), + [aux_sym_connection_token4] = ACTIONS(69), + [sym_connection_identifier] = ACTIONS(69), + [sym__ident_regex] = ACTIONS(71), + [sym__comment] = ACTIONS(69), + }, + [8] = { + [sym_expression] = STATE(8), + [sym_identifier] = STATE(2), + [sym_sub_identifier] = STATE(6), + [sym_connection] = STATE(2), + [aux_sym_source_file_repeat1] = STATE(8), [aux_sym_expression_repeat1] = STATE(2), [aux_sym_identifier_repeat1] = STATE(6), - [ts_builtin_sym_end] = ACTIONS(45), - [anon_sym_DASH] = ACTIONS(47), - [anon_sym_DOT] = ACTIONS(50), - [aux_sym_connection_token1] = ACTIONS(53), - [aux_sym_connection_token2] = ACTIONS(53), - [aux_sym_connection_token3] = ACTIONS(56), - [aux_sym_connection_token4] = ACTIONS(56), - [sym__ident_regex] = ACTIONS(59), - [sym__comment] = ACTIONS(62), + [ts_builtin_sym_end] = ACTIONS(77), + [anon_sym_LPAREN] = ACTIONS(79), + [anon_sym_DASH] = ACTIONS(82), + [anon_sym_DOT] = ACTIONS(85), + [aux_sym_connection_token1] = ACTIONS(88), + [aux_sym_connection_token2] = ACTIONS(88), + [aux_sym_connection_token3] = ACTIONS(91), + [aux_sym_connection_token4] = ACTIONS(91), + [sym__ident_regex] = ACTIONS(94), + [sym__comment] = ACTIONS(97), + }, + [9] = { + [ts_builtin_sym_end] = ACTIONS(100), + [anon_sym_COLON] = ACTIONS(102), + [anon_sym_LPAREN] = ACTIONS(102), + [anon_sym_RPAREN] = ACTIONS(102), + [aux_sym_expression_token1] = ACTIONS(102), + [anon_sym_SEMI] = ACTIONS(102), + [anon_sym_DASH] = ACTIONS(102), + [anon_sym_DOT] = ACTIONS(102), + [aux_sym_connection_token1] = ACTIONS(102), + [aux_sym_connection_token2] = ACTIONS(102), + [aux_sym_connection_token3] = ACTIONS(102), + [aux_sym_connection_token4] = ACTIONS(102), + [aux_sym_connection_token5] = ACTIONS(104), + [sym_connection_identifier] = ACTIONS(102), + [sym__ident_regex] = ACTIONS(102), + [sym__comment] = ACTIONS(102), }, }; static const uint16_t ts_small_parse_table[] = { - [0] = 5, - ACTIONS(7), 1, + [0] = 6, + ACTIONS(21), 1, + anon_sym_COLON, + ACTIONS(31), 1, + ts_builtin_sym_end, + ACTIONS(39), 1, + sym_connection_identifier, + STATE(20), 1, + sym_label, + ACTIONS(37), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(33), 9, + anon_sym_LPAREN, + anon_sym_DASH, anon_sym_DOT, - ACTIONS(65), 1, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [28] = 2, + ACTIONS(106), 1, ts_builtin_sym_end, - ACTIONS(69), 2, + ACTIONS(108), 14, + anon_sym_COLON, + anon_sym_LPAREN, + anon_sym_RPAREN, + aux_sym_expression_token1, + anon_sym_SEMI, anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym_connection_identifier, sym__ident_regex, - STATE(7), 2, - sym_sub_identifier, - aux_sym_identifier_repeat1, - ACTIONS(67), 8, + sym__comment, + [48] = 2, + ACTIONS(100), 1, + ts_builtin_sym_end, + ACTIONS(102), 14, anon_sym_COLON, + anon_sym_LPAREN, + anon_sym_RPAREN, aux_sym_expression_token1, anon_sym_SEMI, + anon_sym_DASH, + anon_sym_DOT, aux_sym_connection_token1, aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, + sym_connection_identifier, + sym__ident_regex, sym__comment, - [25] = 5, - ACTIONS(71), 1, + [68] = 6, + ACTIONS(21), 1, + anon_sym_COLON, + ACTIONS(110), 1, ts_builtin_sym_end, - ACTIONS(78), 1, + ACTIONS(116), 1, + sym_connection_identifier, + STATE(21), 1, + sym_label, + ACTIONS(114), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(112), 9, + anon_sym_LPAREN, + anon_sym_DASH, anon_sym_DOT, - ACTIONS(75), 2, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [96] = 2, + ACTIONS(118), 1, + ts_builtin_sym_end, + ACTIONS(120), 14, + anon_sym_COLON, + anon_sym_LPAREN, + anon_sym_RPAREN, + aux_sym_expression_token1, + anon_sym_SEMI, anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym_connection_identifier, sym__ident_regex, - STATE(7), 2, - sym_sub_identifier, - aux_sym_identifier_repeat1, - ACTIONS(73), 8, + sym__comment, + [116] = 5, + ACTIONS(21), 1, anon_sym_COLON, + ACTIONS(110), 1, + ts_builtin_sym_end, + STATE(21), 1, + sym_label, + ACTIONS(114), 2, aux_sym_expression_token1, anon_sym_SEMI, + ACTIONS(112), 9, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, aux_sym_connection_token1, aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, + sym__ident_regex, sym__comment, - [50] = 3, - ACTIONS(81), 1, + [141] = 5, + ACTIONS(21), 1, + anon_sym_COLON, + ACTIONS(122), 1, ts_builtin_sym_end, - ACTIONS(85), 1, - aux_sym_connection_token5, - ACTIONS(83), 11, + STATE(23), 1, + sym_label, + ACTIONS(126), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(124), 9, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [166] = 5, + ACTIONS(21), 1, anon_sym_COLON, + ACTIONS(128), 1, + ts_builtin_sym_end, + STATE(24), 1, + sym_label, + ACTIONS(132), 2, aux_sym_expression_token1, anon_sym_SEMI, + ACTIONS(130), 9, + anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, @@ -1720,11 +1992,11 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token4, sym__ident_regex, sym__comment, - [70] = 2, - ACTIONS(81), 1, + [191] = 2, + ACTIONS(134), 1, ts_builtin_sym_end, - ACTIONS(83), 11, - anon_sym_COLON, + ACTIONS(136), 11, + anon_sym_LPAREN, aux_sym_expression_token1, anon_sym_SEMI, anon_sym_DASH, @@ -1735,13 +2007,34 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token4, sym__ident_regex, sym__comment, - [87] = 2, - ACTIONS(87), 1, + [208] = 7, + ACTIONS(7), 1, + anon_sym_DASH, + ACTIONS(9), 1, + anon_sym_DOT, + ACTIONS(15), 1, + sym__ident_regex, + ACTIONS(11), 2, + aux_sym_connection_token1, + aux_sym_connection_token2, + ACTIONS(13), 2, + aux_sym_connection_token3, + aux_sym_connection_token4, + STATE(6), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + STATE(3), 3, + sym_identifier, + sym_connection, + aux_sym_expression_repeat1, + [235] = 3, + ACTIONS(110), 1, ts_builtin_sym_end, - ACTIONS(89), 11, - anon_sym_COLON, + ACTIONS(114), 2, aux_sym_expression_token1, anon_sym_SEMI, + ACTIONS(112), 9, + anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, @@ -1750,13 +2043,30 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token4, sym__ident_regex, sym__comment, - [104] = 2, - ACTIONS(91), 1, + [254] = 3, + ACTIONS(122), 1, ts_builtin_sym_end, - ACTIONS(93), 11, - anon_sym_COLON, + ACTIONS(126), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(124), 9, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [273] = 3, + ACTIONS(31), 1, + ts_builtin_sym_end, + ACTIONS(37), 2, aux_sym_expression_token1, anon_sym_SEMI, + ACTIONS(33), 9, + anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, @@ -1765,13 +2075,14 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token4, sym__ident_regex, sym__comment, - [121] = 3, - ACTIONS(95), 1, + [292] = 3, + ACTIONS(128), 1, ts_builtin_sym_end, - ACTIONS(97), 2, + ACTIONS(132), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(99), 8, + ACTIONS(130), 9, + anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, @@ -1780,25 +2091,67 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token4, sym__ident_regex, sym__comment, - [139] = 2, - ACTIONS(101), 1, + [311] = 3, + ACTIONS(138), 1, ts_builtin_sym_end, - ACTIONS(103), 10, + ACTIONS(142), 2, aux_sym_expression_token1, anon_sym_SEMI, + ACTIONS(140), 9, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [330] = 2, + ACTIONS(110), 2, + ts_builtin_sym_end, + sym__ident_regex, + ACTIONS(112), 8, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__comment, + [345] = 2, + ACTIONS(31), 2, + ts_builtin_sym_end, + sym__ident_regex, + ACTIONS(33), 8, + anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, + sym__comment, + [360] = 2, + ACTIONS(122), 2, + ts_builtin_sym_end, sym__ident_regex, + ACTIONS(124), 8, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, sym__comment, - [155] = 2, - ACTIONS(95), 2, + [375] = 2, + ACTIONS(128), 2, ts_builtin_sym_end, sym__ident_regex, - ACTIONS(99), 7, + ACTIONS(130), 8, + anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, @@ -1806,11 +2159,12 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__comment, - [169] = 2, - ACTIONS(105), 2, + [390] = 2, + ACTIONS(138), 2, ts_builtin_sym_end, sym__ident_regex, - ACTIONS(107), 7, + ACTIONS(140), 8, + anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, @@ -1818,102 +2172,164 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__comment, - [183] = 5, - ACTIONS(5), 1, + [405] = 2, + ACTIONS(144), 2, + ts_builtin_sym_end, + sym__ident_regex, + ACTIONS(146), 8, + anon_sym_LPAREN, anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__comment, + [420] = 5, ACTIONS(7), 1, + anon_sym_DASH, + ACTIONS(9), 1, anon_sym_DOT, - ACTIONS(13), 1, + ACTIONS(15), 1, sym__ident_regex, - STATE(10), 1, + STATE(14), 1, sym_identifier, STATE(6), 2, sym_sub_identifier, aux_sym_identifier_repeat1, - [200] = 2, - ACTIONS(109), 1, + [437] = 2, + ACTIONS(148), 1, aux_sym_connection_token1, - ACTIONS(111), 1, + ACTIONS(150), 1, aux_sym_connection_token3, - [207] = 1, - ACTIONS(113), 1, - ts_builtin_sym_end, - [211] = 1, - ACTIONS(115), 1, + [444] = 2, + ACTIONS(152), 1, + anon_sym_DOT, + STATE(16), 1, + sym_sub_identifier, + [451] = 2, + ACTIONS(152), 1, + anon_sym_DOT, + STATE(17), 1, + sym_sub_identifier, + [458] = 2, + ACTIONS(152), 1, + anon_sym_DOT, + STATE(15), 1, + sym_sub_identifier, + [465] = 1, + ACTIONS(154), 1, aux_sym_label_token1, + [469] = 1, + ACTIONS(156), 1, + ts_builtin_sym_end, }; static const uint32_t ts_small_parse_table_map[] = { - [SMALL_STATE(6)] = 0, - [SMALL_STATE(7)] = 25, - [SMALL_STATE(8)] = 50, - [SMALL_STATE(9)] = 70, - [SMALL_STATE(10)] = 87, - [SMALL_STATE(11)] = 104, - [SMALL_STATE(12)] = 121, - [SMALL_STATE(13)] = 139, - [SMALL_STATE(14)] = 155, - [SMALL_STATE(15)] = 169, - [SMALL_STATE(16)] = 183, - [SMALL_STATE(17)] = 200, - [SMALL_STATE(18)] = 207, - [SMALL_STATE(19)] = 211, + [SMALL_STATE(10)] = 0, + [SMALL_STATE(11)] = 28, + [SMALL_STATE(12)] = 48, + [SMALL_STATE(13)] = 68, + [SMALL_STATE(14)] = 96, + [SMALL_STATE(15)] = 116, + [SMALL_STATE(16)] = 141, + [SMALL_STATE(17)] = 166, + [SMALL_STATE(18)] = 191, + [SMALL_STATE(19)] = 208, + [SMALL_STATE(20)] = 235, + [SMALL_STATE(21)] = 254, + [SMALL_STATE(22)] = 273, + [SMALL_STATE(23)] = 292, + [SMALL_STATE(24)] = 311, + [SMALL_STATE(25)] = 330, + [SMALL_STATE(26)] = 345, + [SMALL_STATE(27)] = 360, + [SMALL_STATE(28)] = 375, + [SMALL_STATE(29)] = 390, + [SMALL_STATE(30)] = 405, + [SMALL_STATE(31)] = 420, + [SMALL_STATE(32)] = 437, + [SMALL_STATE(33)] = 444, + [SMALL_STATE(34)] = 451, + [SMALL_STATE(35)] = 458, + [SMALL_STATE(36)] = 465, + [SMALL_STATE(37)] = 469, }; 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_source_file, 0), - [5] = {.entry = {.count = 1, .reusable = false}}, SHIFT(6), - [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(16), - [9] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), + [5] = {.entry = {.count = 1, .reusable = false}}, SHIFT(19), + [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(6), + [9] = {.entry = {.count = 1, .reusable = false}}, SHIFT(31), [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9), - [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), - [15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(4), - [17] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 1), - [19] = {.entry = {.count = 1, .reusable = false}}, SHIFT(19), - [21] = {.entry = {.count = 1, .reusable = false}}, SHIFT(14), + [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(12), + [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), + [17] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5), + [19] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 1), + [21] = {.entry = {.count = 1, .reusable = false}}, SHIFT(36), [23] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 1), - [25] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_expression_repeat1, 2), - [27] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), - [29] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(6), - [32] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(16), - [35] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(8), - [38] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(9), - [41] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), - [43] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5), - [45] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), - [47] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(6), - [50] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(16), - [53] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(8), - [56] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(9), - [59] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(6), - [62] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(5), - [65] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_identifier, 1), - [67] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_identifier, 1), - [69] = {.entry = {.count = 1, .reusable = false}}, SHIFT(7), - [71] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_identifier_repeat1, 2), - [73] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), - [75] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(7), - [78] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(16), - [81] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_connection, 1), - [83] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_connection, 1), - [85] = {.entry = {.count = 1, .reusable = false}}, SHIFT(17), - [87] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sub_identifier, 2), - [89] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sub_identifier, 2), - [91] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_connection, 3), - [93] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_connection, 3), - [95] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 2), - [97] = {.entry = {.count = 1, .reusable = false}}, SHIFT(15), - [99] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 2), - [101] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_label, 2), - [103] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_label, 2), - [105] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 3), - [107] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 3), - [109] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11), - [111] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), - [113] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), - [115] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), + [25] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10), + [27] = {.entry = {.count = 1, .reusable = false}}, SHIFT(26), + [29] = {.entry = {.count = 1, .reusable = false}}, SHIFT(35), + [31] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 2), + [33] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 2), + [35] = {.entry = {.count = 1, .reusable = false}}, SHIFT(13), + [37] = {.entry = {.count = 1, .reusable = false}}, SHIFT(25), + [39] = {.entry = {.count = 1, .reusable = false}}, SHIFT(33), + [41] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_expression_repeat1, 2), + [43] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), + [45] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(6), + [48] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(31), + [51] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(9), + [54] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(12), + [57] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), + [59] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), + [61] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_identifier, 1), + [63] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_identifier, 1), + [65] = {.entry = {.count = 1, .reusable = false}}, SHIFT(7), + [67] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_identifier_repeat1, 2), + [69] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), + [71] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(7), + [74] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(31), + [77] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), + [79] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(19), + [82] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(6), + [85] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(31), + [88] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(9), + [91] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(12), + [94] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(6), + [97] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(8), + [100] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_connection, 1), + [102] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_connection, 1), + [104] = {.entry = {.count = 1, .reusable = false}}, SHIFT(32), + [106] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_connection, 3), + [108] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_connection, 3), + [110] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 3), + [112] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 3), + [114] = {.entry = {.count = 1, .reusable = false}}, SHIFT(27), + [116] = {.entry = {.count = 1, .reusable = false}}, SHIFT(34), + [118] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sub_identifier, 2), + [120] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sub_identifier, 2), + [122] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 4), + [124] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 4), + [126] = {.entry = {.count = 1, .reusable = false}}, SHIFT(28), + [128] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 5), + [130] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 5), + [132] = {.entry = {.count = 1, .reusable = false}}, SHIFT(29), + [134] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_label, 2), + [136] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_label, 2), + [138] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 6), + [140] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 6), + [142] = {.entry = {.count = 1, .reusable = false}}, SHIFT(30), + [144] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 7), + [146] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 7), + [148] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11), + [150] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [152] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), + [154] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), + [156] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), }; #ifdef __cplusplus diff --git a/test/corpus/connections.txt b/test/corpus/connections.txt index ab48cfb..8e4c696 100644 --- a/test/corpus/connections.txt +++ b/test/corpus/connections.txt @@ -233,4 +233,48 @@ Stage Four -> Stage One: repeat (identifier) (connection) (identifier) + (label))) + +==================||| +Connection identifiers +==================||| + +x -> y: hi +x -> y: hello + +(x -> y)[0].style.stroke: red +(x -> y)[1].style.stroke: blue + +---||| + +(source_file + (expression + (identifier) + (connection) + (identifier) + (label)) + (expression + (identifier) + (connection) + (identifier) + (label)) + (expression + (identifier) + (connection) + (identifier) + (connection_identifier) + (sub_identifier + (identifier + (sub_identifier + (identifier)))) + (label)) + (expression + (identifier) + (connection) + (identifier) + (connection_identifier) + (sub_identifier + (identifier + (sub_identifier + (identifier)))) (label))) \ No newline at end of file From c8c9afcd46ba51b6c218698a14b1d88c4ebd902a Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 17 Sep 2023 21:58:47 +0300 Subject: [PATCH 09/11] vscode gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0ec4fe5..189331a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules test.d2 +.vscode \ No newline at end of file From 904701e51fd184a94b59b0544a6536bfdc3c4847 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 17 Sep 2023 22:47:34 +0300 Subject: [PATCH 10/11] add nested syntax support --- grammar.js | 33 +- src/grammar.json | 55 +- src/node-types.json | 47 +- src/parser.c | 1974 ++++++++++++++++++++++++++--------- test/corpus/connections.txt | 27 +- test/corpus/containers.txt | 54 +- test/corpus/labels.txt | 6 +- 7 files changed, 1624 insertions(+), 572 deletions(-) diff --git a/grammar.js b/grammar.js index 1e99466..548636d 100644 --- a/grammar.js +++ b/grammar.js @@ -31,35 +31,18 @@ module.exports = grammar({ $.connection_identifier, $.sub_identifier )), - optional($.label), - optional(choice(/\n+/, ";")), + optional($.label_block), + optional(choice(/\n+\s*/, ";")), )), + label_block: $ => choice( + seq(":", $.label), + seq(":", $.container), + ), + container: $ => seq("{", repeat($.expression), "}"), - label: _ => seq(":", choice( - // seq("|", /.+/, "|"), - /.+/, - )), - - // shape_body: $ => prec.right(seq( - // "{", - // /\s*/, - // repeat(seq(/\s*/, $.shape_param)), - // /\s*/, - // "}" - // )), - - // shape_param: $ => seq( - // $.identifier, - // /\s*/, - // ":", - // optional(/\s+/), - // $.param_value, - // optional($.param_body), - // ), - - // param_body: $ => seq("{", /.+/, "}"), + label: _ => /.+/, // building blocks diff --git a/src/grammar.json b/src/grammar.json index a37b7eb..15a8b16 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -136,7 +136,7 @@ "members": [ { "type": "SYMBOL", - "name": "label" + "name": "label_block" }, { "type": "BLANK" @@ -151,7 +151,7 @@ "members": [ { "type": "PATTERN", - "value": "\\n+" + "value": "\\n+\\s*" }, { "type": "STRING", @@ -167,24 +167,61 @@ ] } }, - "label": { - "type": "SEQ", + "label_block": { + "type": "CHOICE", "members": [ { - "type": "STRING", - "value": ":" + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": ":" + }, + { + "type": "SYMBOL", + "name": "label" + } + ] }, { - "type": "CHOICE", + "type": "SEQ", "members": [ { - "type": "PATTERN", - "value": ".+" + "type": "STRING", + "value": ":" + }, + { + "type": "SYMBOL", + "name": "container" } ] } ] }, + "container": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "{" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "expression" + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "label": { + "type": "PATTERN", + "value": ".+" + }, "identifier": { "type": "PREC_RIGHT", "value": 0, diff --git a/src/node-types.json b/src/node-types.json index d60e304..9b4b557 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -4,6 +4,21 @@ "named": true, "fields": {} }, + { + "type": "container", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "expression", + "named": true + } + ] + } + }, { "type": "expression", "named": true, @@ -25,7 +40,7 @@ "named": true }, { - "type": "label", + "type": "label_block", "named": true }, { @@ -51,9 +66,23 @@ } }, { - "type": "label", + "type": "label_block", "named": true, - "fields": {} + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "container", + "named": true + }, + { + "type": "label", + "named": true + } + ] + } }, { "type": "source_file", @@ -121,6 +150,10 @@ "type": "down", "named": false }, + { + "type": "label", + "named": true + }, { "type": "left", "named": false @@ -132,5 +165,13 @@ { "type": "up", "named": false + }, + { + "type": "{", + "named": false + }, + { + "type": "}", + "named": false } ] \ No newline at end of file diff --git a/src/parser.c b/src/parser.c index 2eeb4ad..908cd28 100644 --- a/src/parser.c +++ b/src/parser.c @@ -6,11 +6,11 @@ #endif #define LANGUAGE_VERSION 14 -#define STATE_COUNT 38 -#define LARGE_STATE_COUNT 10 -#define SYMBOL_COUNT 31 +#define STATE_COUNT 80 +#define LARGE_STATE_COUNT 8 +#define SYMBOL_COUNT 35 #define ALIAS_COUNT 0 -#define TOKEN_COUNT 22 +#define TOKEN_COUNT 24 #define EXTERNAL_TOKEN_COUNT 0 #define FIELD_COUNT 0 #define MAX_ALIAS_SEQUENCE_LENGTH 7 @@ -27,26 +27,30 @@ enum { anon_sym_RPAREN = 8, aux_sym_expression_token1 = 9, anon_sym_SEMI = 10, - aux_sym_label_token1 = 11, - anon_sym_DASH = 12, - anon_sym_DOT = 13, - aux_sym_connection_token1 = 14, - aux_sym_connection_token2 = 15, - aux_sym_connection_token3 = 16, - aux_sym_connection_token4 = 17, - aux_sym_connection_token5 = 18, - sym_connection_identifier = 19, - sym__ident_regex = 20, - sym__comment = 21, - sym_source_file = 22, - sym_expression = 23, - sym_label = 24, - sym_identifier = 25, - sym_sub_identifier = 26, - sym_connection = 27, - aux_sym_source_file_repeat1 = 28, - aux_sym_expression_repeat1 = 29, - aux_sym_identifier_repeat1 = 30, + anon_sym_LBRACE = 11, + anon_sym_RBRACE = 12, + sym_label = 13, + anon_sym_DASH = 14, + anon_sym_DOT = 15, + aux_sym_connection_token1 = 16, + aux_sym_connection_token2 = 17, + aux_sym_connection_token3 = 18, + aux_sym_connection_token4 = 19, + aux_sym_connection_token5 = 20, + sym_connection_identifier = 21, + sym__ident_regex = 22, + sym__comment = 23, + sym_source_file = 24, + sym_expression = 25, + sym_label_block = 26, + sym_container = 27, + sym_identifier = 28, + sym_sub_identifier = 29, + sym_connection = 30, + aux_sym_source_file_repeat1 = 31, + aux_sym_expression_repeat1 = 32, + aux_sym_container_repeat1 = 33, + aux_sym_identifier_repeat1 = 34, }; static const char * const ts_symbol_names[] = { @@ -61,7 +65,9 @@ static const char * const ts_symbol_names[] = { [anon_sym_RPAREN] = ")", [aux_sym_expression_token1] = "expression_token1", [anon_sym_SEMI] = ";", - [aux_sym_label_token1] = "label_token1", + [anon_sym_LBRACE] = "{", + [anon_sym_RBRACE] = "}", + [sym_label] = "label", [anon_sym_DASH] = "-", [anon_sym_DOT] = ".", [aux_sym_connection_token1] = "connection_token1", @@ -74,12 +80,14 @@ static const char * const ts_symbol_names[] = { [sym__comment] = "_comment", [sym_source_file] = "source_file", [sym_expression] = "expression", - [sym_label] = "label", + [sym_label_block] = "label_block", + [sym_container] = "container", [sym_identifier] = "identifier", [sym_sub_identifier] = "sub_identifier", [sym_connection] = "connection", [aux_sym_source_file_repeat1] = "source_file_repeat1", [aux_sym_expression_repeat1] = "expression_repeat1", + [aux_sym_container_repeat1] = "container_repeat1", [aux_sym_identifier_repeat1] = "identifier_repeat1", }; @@ -95,7 +103,9 @@ static const TSSymbol ts_symbol_map[] = { [anon_sym_RPAREN] = anon_sym_RPAREN, [aux_sym_expression_token1] = aux_sym_expression_token1, [anon_sym_SEMI] = anon_sym_SEMI, - [aux_sym_label_token1] = aux_sym_label_token1, + [anon_sym_LBRACE] = anon_sym_LBRACE, + [anon_sym_RBRACE] = anon_sym_RBRACE, + [sym_label] = sym_label, [anon_sym_DASH] = anon_sym_DASH, [anon_sym_DOT] = anon_sym_DOT, [aux_sym_connection_token1] = aux_sym_connection_token1, @@ -108,12 +118,14 @@ static const TSSymbol ts_symbol_map[] = { [sym__comment] = sym__comment, [sym_source_file] = sym_source_file, [sym_expression] = sym_expression, - [sym_label] = sym_label, + [sym_label_block] = sym_label_block, + [sym_container] = sym_container, [sym_identifier] = sym_identifier, [sym_sub_identifier] = sym_sub_identifier, [sym_connection] = sym_connection, [aux_sym_source_file_repeat1] = aux_sym_source_file_repeat1, [aux_sym_expression_repeat1] = aux_sym_expression_repeat1, + [aux_sym_container_repeat1] = aux_sym_container_repeat1, [aux_sym_identifier_repeat1] = aux_sym_identifier_repeat1, }; @@ -162,10 +174,18 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = false, }, - [aux_sym_label_token1] = { - .visible = false, + [anon_sym_LBRACE] = { + .visible = true, + .named = false, + }, + [anon_sym_RBRACE] = { + .visible = true, .named = false, }, + [sym_label] = { + .visible = true, + .named = true, + }, [anon_sym_DASH] = { .visible = true, .named = false, @@ -214,7 +234,11 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, - [sym_label] = { + [sym_label_block] = { + .visible = true, + .named = true, + }, + [sym_container] = { .visible = true, .named = true, }, @@ -238,6 +262,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = false, .named = false, }, + [aux_sym_container_repeat1] = { + .visible = false, + .named = false, + }, [aux_sym_identifier_repeat1] = { .visible = false, .named = false, @@ -257,10 +285,10 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [1] = 1, [2] = 2, [3] = 3, - [4] = 4, - [5] = 5, + [4] = 2, + [5] = 3, [6] = 6, - [7] = 7, + [7] = 6, [8] = 8, [9] = 9, [10] = 10, @@ -268,29 +296,71 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [12] = 12, [13] = 13, [14] = 14, - [15] = 15, - [16] = 16, + [15] = 11, + [16] = 14, [17] = 17, - [18] = 18, - [19] = 19, + [18] = 8, + [19] = 13, [20] = 20, [21] = 21, [22] = 22, - [23] = 23, + [23] = 17, [24] = 24, [25] = 25, - [26] = 26, - [27] = 27, + [26] = 25, + [27] = 21, [28] = 28, - [29] = 29, - [30] = 30, + [29] = 22, + [30] = 20, [31] = 31, - [32] = 32, + [32] = 24, [33] = 33, - [34] = 34, - [35] = 35, - [36] = 36, + [34] = 31, + [35] = 33, + [36] = 28, [37] = 37, + [38] = 38, + [39] = 39, + [40] = 40, + [41] = 38, + [42] = 42, + [43] = 43, + [44] = 44, + [45] = 45, + [46] = 46, + [47] = 43, + [48] = 40, + [49] = 39, + [50] = 45, + [51] = 44, + [52] = 46, + [53] = 42, + [54] = 37, + [55] = 55, + [56] = 56, + [57] = 57, + [58] = 58, + [59] = 59, + [60] = 60, + [61] = 55, + [62] = 58, + [63] = 60, + [64] = 59, + [65] = 56, + [66] = 57, + [67] = 67, + [68] = 67, + [69] = 69, + [70] = 69, + [71] = 71, + [72] = 72, + [73] = 73, + [74] = 73, + [75] = 75, + [76] = 72, + [77] = 71, + [78] = 75, + [79] = 79, }; static inline bool sym__ident_regex_character_set_1(int32_t c) { @@ -1330,8 +1400,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == '#') ADVANCE(1); if (lookahead == '(') ADVANCE(36); if (lookahead == ')') ADVANCE(37); - if (lookahead == '-') ADVANCE(43); - if (lookahead == '.') ADVANCE(44); + if (lookahead == '-') ADVANCE(46); + if (lookahead == '.') ADVANCE(47); if (lookahead == ':') ADVANCE(31); if (lookahead == ';') ADVANCE(39); if (lookahead == '<') ADVANCE(6); @@ -1341,45 +1411,48 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == 'l') ADVANCE(9); if (lookahead == 'r') ADVANCE(15); if (lookahead == 'u') ADVANCE(20); + if (lookahead == '{') ADVANCE(40); + if (lookahead == '}') ADVANCE(42); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') SKIP(0) END_STATE(); case 1: - if (lookahead == '\n') ADVANCE(55); + if (lookahead == '\n') ADVANCE(58); if (lookahead != 0) ADVANCE(1); END_STATE(); case 2: if (lookahead == '\n') ADVANCE(3); END_STATE(); case 3: - if (lookahead == '\n') ADVANCE(49); + if (lookahead == '\n') ADVANCE(52); if (lookahead == '\t' || lookahead == '\r' || - lookahead == ' ') ADVANCE(50); + lookahead == ' ') ADVANCE(53); END_STATE(); case 4: if (lookahead == '\n') SKIP(4) + if (lookahead == '{') ADVANCE(41); if (lookahead == '\t' || lookahead == '\r' || - lookahead == ' ') ADVANCE(40); - if (lookahead != 0) ADVANCE(41); + lookahead == ' ') ADVANCE(43); + if (lookahead != 0) ADVANCE(44); END_STATE(); case 5: - if (lookahead == ' ') ADVANCE(53); - if (lookahead == '-') ADVANCE(42); - if (lookahead == '.') ADVANCE(44); + if (lookahead == ' ') ADVANCE(56); + if (lookahead == '-') ADVANCE(45); + if (lookahead == '.') ADVANCE(47); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r') SKIP(5) - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(54); + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(57); END_STATE(); case 6: - if (lookahead == '-') ADVANCE(46); + if (lookahead == '-') ADVANCE(49); END_STATE(); case 7: - if (lookahead == ']') ADVANCE(51); + if (lookahead == ']') ADVANCE(54); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(7); END_STATE(); case 8: @@ -1443,33 +1516,35 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { case 27: if (eof) ADVANCE(29); if (lookahead == '\n') ADVANCE(38); - if (lookahead == ' ') ADVANCE(52); + if (lookahead == ' ') ADVANCE(55); if (lookahead == '#') ADVANCE(1); if (lookahead == '(') ADVANCE(36); if (lookahead == ')') ADVANCE(37); - if (lookahead == '-') ADVANCE(43); - if (lookahead == '.') ADVANCE(44); + if (lookahead == '-') ADVANCE(46); + if (lookahead == '.') ADVANCE(47); if (lookahead == ':') ADVANCE(31); if (lookahead == ';') ADVANCE(39); if (lookahead == '<') ADVANCE(6); if (lookahead == '[') ADVANCE(26); if (lookahead == '\\') ADVANCE(2); + if (lookahead == '}') ADVANCE(42); if (lookahead == '\t' || lookahead == '\r') SKIP(27) - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(54); + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(57); END_STATE(); case 28: if (eof) ADVANCE(29); - if (lookahead == ' ') ADVANCE(53); + if (lookahead == ' ') ADVANCE(56); if (lookahead == '#') ADVANCE(1); if (lookahead == '(') ADVANCE(36); - if (lookahead == '-') ADVANCE(43); - if (lookahead == '.') ADVANCE(44); + if (lookahead == '-') ADVANCE(46); + if (lookahead == '.') ADVANCE(47); if (lookahead == '<') ADVANCE(6); + if (lookahead == '}') ADVANCE(42); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r') SKIP(28) - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(54); + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(57); END_STATE(); case 29: ACCEPT_TOKEN(ts_builtin_sym_end); @@ -1501,84 +1576,98 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { case 38: ACCEPT_TOKEN(aux_sym_expression_token1); if (lookahead == '\n') ADVANCE(38); - if (lookahead == ' ') ADVANCE(52); + if (lookahead == ' ') ADVANCE(38); + if (lookahead == '\t' || + lookahead == '\r') ADVANCE(38); END_STATE(); case 39: ACCEPT_TOKEN(anon_sym_SEMI); END_STATE(); case 40: - ACCEPT_TOKEN(aux_sym_label_token1); + ACCEPT_TOKEN(anon_sym_LBRACE); + END_STATE(); + case 41: + ACCEPT_TOKEN(anon_sym_LBRACE); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(44); + END_STATE(); + case 42: + ACCEPT_TOKEN(anon_sym_RBRACE); + END_STATE(); + case 43: + ACCEPT_TOKEN(sym_label); + if (lookahead == '{') ADVANCE(41); if (lookahead == '\t' || lookahead == '\r' || - lookahead == ' ') ADVANCE(40); + lookahead == ' ') ADVANCE(43); if (lookahead != 0 && - lookahead != '\n') ADVANCE(41); + lookahead != '\n') ADVANCE(44); END_STATE(); - case 41: - ACCEPT_TOKEN(aux_sym_label_token1); + case 44: + ACCEPT_TOKEN(sym_label); if (lookahead != 0 && - lookahead != '\n') ADVANCE(41); + lookahead != '\n') ADVANCE(44); END_STATE(); - case 42: + case 45: ACCEPT_TOKEN(anon_sym_DASH); END_STATE(); - case 43: + case 46: ACCEPT_TOKEN(anon_sym_DASH); - if (lookahead == '-') ADVANCE(45); - if (lookahead == '>') ADVANCE(47); + if (lookahead == '-') ADVANCE(48); + if (lookahead == '>') ADVANCE(50); END_STATE(); - case 44: + case 47: ACCEPT_TOKEN(anon_sym_DOT); END_STATE(); - case 45: + case 48: ACCEPT_TOKEN(aux_sym_connection_token1); - if (lookahead == '-') ADVANCE(45); - if (lookahead == '>') ADVANCE(47); + if (lookahead == '-') ADVANCE(48); + if (lookahead == '>') ADVANCE(50); END_STATE(); - case 46: + case 49: ACCEPT_TOKEN(aux_sym_connection_token2); - if (lookahead == '-') ADVANCE(46); - if (lookahead == '>') ADVANCE(48); + if (lookahead == '-') ADVANCE(49); + if (lookahead == '>') ADVANCE(51); END_STATE(); - case 47: + case 50: ACCEPT_TOKEN(aux_sym_connection_token3); END_STATE(); - case 48: + case 51: ACCEPT_TOKEN(aux_sym_connection_token4); END_STATE(); - case 49: + case 52: ACCEPT_TOKEN(aux_sym_connection_token5); - if (lookahead == '\n') ADVANCE(49); + if (lookahead == '\n') ADVANCE(52); if (lookahead == '\t' || lookahead == '\r' || - lookahead == ' ') ADVANCE(50); + lookahead == ' ') ADVANCE(53); END_STATE(); - case 50: + case 53: ACCEPT_TOKEN(aux_sym_connection_token5); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || - lookahead == ' ') ADVANCE(50); + lookahead == ' ') ADVANCE(53); END_STATE(); - case 51: + case 54: ACCEPT_TOKEN(sym_connection_identifier); END_STATE(); - case 52: + case 55: ACCEPT_TOKEN(sym__ident_regex); if (lookahead == '\n') ADVANCE(38); - if (lookahead == ' ') ADVANCE(52); - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(54); + if (lookahead == ' ') ADVANCE(55); + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(57); END_STATE(); - case 53: + case 56: ACCEPT_TOKEN(sym__ident_regex); - if (lookahead == ' ') ADVANCE(53); - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(54); + if (lookahead == ' ') ADVANCE(56); + if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(57); END_STATE(); - case 54: + case 57: ACCEPT_TOKEN(sym__ident_regex); - if (sym__ident_regex_character_set_2(lookahead)) ADVANCE(54); + if (sym__ident_regex_character_set_2(lookahead)) ADVANCE(57); END_STATE(); - case 55: + case 58: ACCEPT_TOKEN(sym__comment); END_STATE(); default: @@ -1592,18 +1681,18 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [2] = {.lex_state = 27}, [3] = {.lex_state = 27}, [4] = {.lex_state = 27}, - [5] = {.lex_state = 28}, + [5] = {.lex_state = 27}, [6] = {.lex_state = 27}, [7] = {.lex_state = 27}, - [8] = {.lex_state = 28}, - [9] = {.lex_state = 27}, - [10] = {.lex_state = 27}, + [8] = {.lex_state = 27}, + [9] = {.lex_state = 28}, + [10] = {.lex_state = 28}, [11] = {.lex_state = 27}, - [12] = {.lex_state = 27}, - [13] = {.lex_state = 27}, - [14] = {.lex_state = 27}, + [12] = {.lex_state = 28}, + [13] = {.lex_state = 28}, + [14] = {.lex_state = 28}, [15] = {.lex_state = 27}, - [16] = {.lex_state = 27}, + [16] = {.lex_state = 28}, [17] = {.lex_state = 27}, [18] = {.lex_state = 27}, [19] = {.lex_state = 28}, @@ -1612,19 +1701,61 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [22] = {.lex_state = 27}, [23] = {.lex_state = 27}, [24] = {.lex_state = 27}, - [25] = {.lex_state = 28}, - [26] = {.lex_state = 28}, - [27] = {.lex_state = 28}, - [28] = {.lex_state = 28}, - [29] = {.lex_state = 28}, - [30] = {.lex_state = 28}, - [31] = {.lex_state = 5}, - [32] = {.lex_state = 0}, - [33] = {.lex_state = 0}, - [34] = {.lex_state = 0}, - [35] = {.lex_state = 0}, - [36] = {.lex_state = 4}, - [37] = {.lex_state = 0}, + [25] = {.lex_state = 27}, + [26] = {.lex_state = 27}, + [27] = {.lex_state = 27}, + [28] = {.lex_state = 27}, + [29] = {.lex_state = 27}, + [30] = {.lex_state = 27}, + [31] = {.lex_state = 27}, + [32] = {.lex_state = 27}, + [33] = {.lex_state = 27}, + [34] = {.lex_state = 27}, + [35] = {.lex_state = 27}, + [36] = {.lex_state = 27}, + [37] = {.lex_state = 27}, + [38] = {.lex_state = 28}, + [39] = {.lex_state = 27}, + [40] = {.lex_state = 27}, + [41] = {.lex_state = 28}, + [42] = {.lex_state = 27}, + [43] = {.lex_state = 27}, + [44] = {.lex_state = 27}, + [45] = {.lex_state = 27}, + [46] = {.lex_state = 27}, + [47] = {.lex_state = 27}, + [48] = {.lex_state = 27}, + [49] = {.lex_state = 27}, + [50] = {.lex_state = 27}, + [51] = {.lex_state = 27}, + [52] = {.lex_state = 27}, + [53] = {.lex_state = 27}, + [54] = {.lex_state = 27}, + [55] = {.lex_state = 28}, + [56] = {.lex_state = 28}, + [57] = {.lex_state = 28}, + [58] = {.lex_state = 28}, + [59] = {.lex_state = 28}, + [60] = {.lex_state = 28}, + [61] = {.lex_state = 28}, + [62] = {.lex_state = 28}, + [63] = {.lex_state = 28}, + [64] = {.lex_state = 28}, + [65] = {.lex_state = 28}, + [66] = {.lex_state = 28}, + [67] = {.lex_state = 5}, + [68] = {.lex_state = 5}, + [69] = {.lex_state = 4}, + [70] = {.lex_state = 4}, + [71] = {.lex_state = 0}, + [72] = {.lex_state = 0}, + [73] = {.lex_state = 0}, + [74] = {.lex_state = 0}, + [75] = {.lex_state = 0}, + [76] = {.lex_state = 0}, + [77] = {.lex_state = 0}, + [78] = {.lex_state = 0}, + [79] = {.lex_state = 0}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { @@ -1639,6 +1770,8 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_LPAREN] = ACTIONS(1), [anon_sym_RPAREN] = ACTIONS(1), [anon_sym_SEMI] = ACTIONS(1), + [anon_sym_LBRACE] = ACTIONS(1), + [anon_sym_RBRACE] = ACTIONS(1), [anon_sym_DASH] = ACTIONS(1), [anon_sym_DOT] = ACTIONS(1), [aux_sym_connection_token1] = ACTIONS(1), @@ -1650,14 +1783,14 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [sym__comment] = ACTIONS(1), }, [1] = { - [sym_source_file] = STATE(37), - [sym_expression] = STATE(5), + [sym_source_file] = STATE(79), + [sym_expression] = STATE(10), [sym_identifier] = STATE(2), - [sym_sub_identifier] = STATE(6), + [sym_sub_identifier] = STATE(8), [sym_connection] = STATE(2), - [aux_sym_source_file_repeat1] = STATE(5), + [aux_sym_source_file_repeat1] = STATE(10), [aux_sym_expression_repeat1] = STATE(2), - [aux_sym_identifier_repeat1] = STATE(6), + [aux_sym_identifier_repeat1] = STATE(8), [ts_builtin_sym_end] = ACTIONS(3), [anon_sym_LPAREN] = ACTIONS(5), [anon_sym_DASH] = ACTIONS(7), @@ -1670,12 +1803,12 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [sym__comment] = ACTIONS(17), }, [2] = { - [sym_label] = STATE(22), - [sym_identifier] = STATE(4), - [sym_sub_identifier] = STATE(6), - [sym_connection] = STATE(4), - [aux_sym_expression_repeat1] = STATE(4), - [aux_sym_identifier_repeat1] = STATE(6), + [sym_label_block] = STATE(42), + [sym_identifier] = STATE(6), + [sym_sub_identifier] = STATE(8), + [sym_connection] = STATE(6), + [aux_sym_expression_repeat1] = STATE(6), + [aux_sym_identifier_repeat1] = STATE(8), [ts_builtin_sym_end] = ACTIONS(19), [anon_sym_COLON] = ACTIONS(21), [anon_sym_LPAREN] = ACTIONS(23), @@ -1693,12 +1826,12 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [sym__comment] = ACTIONS(23), }, [3] = { - [sym_label] = STATE(20), - [sym_identifier] = STATE(4), - [sym_sub_identifier] = STATE(6), - [sym_connection] = STATE(4), - [aux_sym_expression_repeat1] = STATE(4), - [aux_sym_identifier_repeat1] = STATE(6), + [sym_label_block] = STATE(43), + [sym_identifier] = STATE(6), + [sym_sub_identifier] = STATE(8), + [sym_connection] = STATE(6), + [aux_sym_expression_repeat1] = STATE(6), + [aux_sym_identifier_repeat1] = STATE(8), [ts_builtin_sym_end] = ACTIONS(31), [anon_sym_COLON] = ACTIONS(21), [anon_sym_LPAREN] = ACTIONS(33), @@ -1716,372 +1849,445 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [sym__comment] = ACTIONS(33), }, [4] = { - [sym_identifier] = STATE(4), - [sym_sub_identifier] = STATE(6), - [sym_connection] = STATE(4), - [aux_sym_expression_repeat1] = STATE(4), - [aux_sym_identifier_repeat1] = STATE(6), - [ts_builtin_sym_end] = ACTIONS(41), - [anon_sym_COLON] = ACTIONS(43), - [anon_sym_LPAREN] = ACTIONS(43), + [sym_label_block] = STATE(53), + [sym_identifier] = STATE(7), + [sym_sub_identifier] = STATE(18), + [sym_connection] = STATE(7), + [aux_sym_expression_repeat1] = STATE(7), + [aux_sym_identifier_repeat1] = STATE(18), + [anon_sym_COLON] = ACTIONS(41), + [anon_sym_LPAREN] = ACTIONS(23), [anon_sym_RPAREN] = ACTIONS(43), - [aux_sym_expression_token1] = ACTIONS(43), - [anon_sym_SEMI] = ACTIONS(43), - [anon_sym_DASH] = ACTIONS(45), - [anon_sym_DOT] = ACTIONS(48), + [aux_sym_expression_token1] = ACTIONS(45), + [anon_sym_SEMI] = ACTIONS(45), + [anon_sym_RBRACE] = ACTIONS(23), + [anon_sym_DASH] = ACTIONS(47), + [anon_sym_DOT] = ACTIONS(49), [aux_sym_connection_token1] = ACTIONS(51), [aux_sym_connection_token2] = ACTIONS(51), - [aux_sym_connection_token3] = ACTIONS(54), - [aux_sym_connection_token4] = ACTIONS(54), - [sym_connection_identifier] = ACTIONS(43), - [sym__ident_regex] = ACTIONS(45), - [sym__comment] = ACTIONS(43), + [aux_sym_connection_token3] = ACTIONS(53), + [aux_sym_connection_token4] = ACTIONS(53), + [sym_connection_identifier] = ACTIONS(55), + [sym__ident_regex] = ACTIONS(47), }, [5] = { - [sym_expression] = STATE(8), - [sym_identifier] = STATE(2), - [sym_sub_identifier] = STATE(6), - [sym_connection] = STATE(2), - [aux_sym_source_file_repeat1] = STATE(8), - [aux_sym_expression_repeat1] = STATE(2), - [aux_sym_identifier_repeat1] = STATE(6), - [ts_builtin_sym_end] = ACTIONS(57), - [anon_sym_LPAREN] = ACTIONS(5), - [anon_sym_DASH] = ACTIONS(7), - [anon_sym_DOT] = ACTIONS(9), - [aux_sym_connection_token1] = ACTIONS(11), - [aux_sym_connection_token2] = ACTIONS(11), - [aux_sym_connection_token3] = ACTIONS(13), - [aux_sym_connection_token4] = ACTIONS(13), - [sym__ident_regex] = ACTIONS(15), - [sym__comment] = ACTIONS(59), + [sym_label_block] = STATE(47), + [sym_identifier] = STATE(7), + [sym_sub_identifier] = STATE(18), + [sym_connection] = STATE(7), + [aux_sym_expression_repeat1] = STATE(7), + [aux_sym_identifier_repeat1] = STATE(18), + [anon_sym_COLON] = ACTIONS(41), + [anon_sym_LPAREN] = ACTIONS(33), + [anon_sym_RPAREN] = ACTIONS(57), + [aux_sym_expression_token1] = ACTIONS(59), + [anon_sym_SEMI] = ACTIONS(59), + [anon_sym_RBRACE] = ACTIONS(33), + [anon_sym_DASH] = ACTIONS(47), + [anon_sym_DOT] = ACTIONS(49), + [aux_sym_connection_token1] = ACTIONS(51), + [aux_sym_connection_token2] = ACTIONS(51), + [aux_sym_connection_token3] = ACTIONS(53), + [aux_sym_connection_token4] = ACTIONS(53), + [sym_connection_identifier] = ACTIONS(61), + [sym__ident_regex] = ACTIONS(47), }, [6] = { - [sym_sub_identifier] = STATE(7), - [aux_sym_identifier_repeat1] = STATE(7), - [ts_builtin_sym_end] = ACTIONS(61), - [anon_sym_COLON] = ACTIONS(63), - [anon_sym_LPAREN] = ACTIONS(63), - [anon_sym_RPAREN] = ACTIONS(63), - [aux_sym_expression_token1] = ACTIONS(63), - [anon_sym_SEMI] = ACTIONS(63), - [anon_sym_DASH] = ACTIONS(65), - [anon_sym_DOT] = ACTIONS(9), - [aux_sym_connection_token1] = ACTIONS(63), - [aux_sym_connection_token2] = ACTIONS(63), - [aux_sym_connection_token3] = ACTIONS(63), - [aux_sym_connection_token4] = ACTIONS(63), - [sym_connection_identifier] = ACTIONS(63), - [sym__ident_regex] = ACTIONS(65), - [sym__comment] = ACTIONS(63), + [sym_identifier] = STATE(6), + [sym_sub_identifier] = STATE(8), + [sym_connection] = STATE(6), + [aux_sym_expression_repeat1] = STATE(6), + [aux_sym_identifier_repeat1] = STATE(8), + [ts_builtin_sym_end] = ACTIONS(63), + [anon_sym_COLON] = ACTIONS(65), + [anon_sym_LPAREN] = ACTIONS(65), + [anon_sym_RPAREN] = ACTIONS(65), + [aux_sym_expression_token1] = ACTIONS(65), + [anon_sym_SEMI] = ACTIONS(65), + [anon_sym_DASH] = ACTIONS(67), + [anon_sym_DOT] = ACTIONS(70), + [aux_sym_connection_token1] = ACTIONS(73), + [aux_sym_connection_token2] = ACTIONS(73), + [aux_sym_connection_token3] = ACTIONS(76), + [aux_sym_connection_token4] = ACTIONS(76), + [sym_connection_identifier] = ACTIONS(65), + [sym__ident_regex] = ACTIONS(67), + [sym__comment] = ACTIONS(65), }, [7] = { - [sym_sub_identifier] = STATE(7), - [aux_sym_identifier_repeat1] = STATE(7), - [ts_builtin_sym_end] = ACTIONS(67), - [anon_sym_COLON] = ACTIONS(69), - [anon_sym_LPAREN] = ACTIONS(69), - [anon_sym_RPAREN] = ACTIONS(69), - [aux_sym_expression_token1] = ACTIONS(69), - [anon_sym_SEMI] = ACTIONS(69), - [anon_sym_DASH] = ACTIONS(71), - [anon_sym_DOT] = ACTIONS(74), - [aux_sym_connection_token1] = ACTIONS(69), - [aux_sym_connection_token2] = ACTIONS(69), - [aux_sym_connection_token3] = ACTIONS(69), - [aux_sym_connection_token4] = ACTIONS(69), - [sym_connection_identifier] = ACTIONS(69), - [sym__ident_regex] = ACTIONS(71), - [sym__comment] = ACTIONS(69), - }, - [8] = { - [sym_expression] = STATE(8), - [sym_identifier] = STATE(2), - [sym_sub_identifier] = STATE(6), - [sym_connection] = STATE(2), - [aux_sym_source_file_repeat1] = STATE(8), - [aux_sym_expression_repeat1] = STATE(2), - [aux_sym_identifier_repeat1] = STATE(6), - [ts_builtin_sym_end] = ACTIONS(77), - [anon_sym_LPAREN] = ACTIONS(79), - [anon_sym_DASH] = ACTIONS(82), - [anon_sym_DOT] = ACTIONS(85), - [aux_sym_connection_token1] = ACTIONS(88), - [aux_sym_connection_token2] = ACTIONS(88), - [aux_sym_connection_token3] = ACTIONS(91), - [aux_sym_connection_token4] = ACTIONS(91), - [sym__ident_regex] = ACTIONS(94), - [sym__comment] = ACTIONS(97), - }, - [9] = { - [ts_builtin_sym_end] = ACTIONS(100), - [anon_sym_COLON] = ACTIONS(102), - [anon_sym_LPAREN] = ACTIONS(102), - [anon_sym_RPAREN] = ACTIONS(102), - [aux_sym_expression_token1] = ACTIONS(102), - [anon_sym_SEMI] = ACTIONS(102), - [anon_sym_DASH] = ACTIONS(102), - [anon_sym_DOT] = ACTIONS(102), - [aux_sym_connection_token1] = ACTIONS(102), - [aux_sym_connection_token2] = ACTIONS(102), - [aux_sym_connection_token3] = ACTIONS(102), - [aux_sym_connection_token4] = ACTIONS(102), - [aux_sym_connection_token5] = ACTIONS(104), - [sym_connection_identifier] = ACTIONS(102), - [sym__ident_regex] = ACTIONS(102), - [sym__comment] = ACTIONS(102), + [sym_identifier] = STATE(7), + [sym_sub_identifier] = STATE(18), + [sym_connection] = STATE(7), + [aux_sym_expression_repeat1] = STATE(7), + [aux_sym_identifier_repeat1] = STATE(18), + [anon_sym_COLON] = ACTIONS(65), + [anon_sym_LPAREN] = ACTIONS(65), + [anon_sym_RPAREN] = ACTIONS(65), + [aux_sym_expression_token1] = ACTIONS(65), + [anon_sym_SEMI] = ACTIONS(65), + [anon_sym_RBRACE] = ACTIONS(65), + [anon_sym_DASH] = ACTIONS(79), + [anon_sym_DOT] = ACTIONS(82), + [aux_sym_connection_token1] = ACTIONS(85), + [aux_sym_connection_token2] = ACTIONS(85), + [aux_sym_connection_token3] = ACTIONS(88), + [aux_sym_connection_token4] = ACTIONS(88), + [sym_connection_identifier] = ACTIONS(65), + [sym__ident_regex] = ACTIONS(79), }, }; static const uint16_t ts_small_parse_table[] = { - [0] = 6, - ACTIONS(21), 1, - anon_sym_COLON, - ACTIONS(31), 1, + [0] = 5, + ACTIONS(9), 1, + anon_sym_DOT, + ACTIONS(91), 1, ts_builtin_sym_end, - ACTIONS(39), 1, - sym_connection_identifier, - STATE(20), 1, - sym_label, - ACTIONS(37), 2, - aux_sym_expression_token1, - anon_sym_SEMI, - ACTIONS(33), 9, - anon_sym_LPAREN, + ACTIONS(95), 2, anon_sym_DASH, - anon_sym_DOT, - aux_sym_connection_token1, - aux_sym_connection_token2, - aux_sym_connection_token3, - aux_sym_connection_token4, sym__ident_regex, - sym__comment, - [28] = 2, - ACTIONS(106), 1, - ts_builtin_sym_end, - ACTIONS(108), 14, + STATE(11), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + ACTIONS(93), 11, anon_sym_COLON, anon_sym_LPAREN, anon_sym_RPAREN, aux_sym_expression_token1, anon_sym_SEMI, - anon_sym_DASH, - anon_sym_DOT, aux_sym_connection_token1, aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, sym_connection_identifier, - sym__ident_regex, sym__comment, - [48] = 2, - ACTIONS(100), 1, + [28] = 11, + ACTIONS(97), 1, ts_builtin_sym_end, - ACTIONS(102), 14, - anon_sym_COLON, + ACTIONS(99), 1, anon_sym_LPAREN, - anon_sym_RPAREN, - aux_sym_expression_token1, - anon_sym_SEMI, + ACTIONS(102), 1, anon_sym_DASH, + ACTIONS(105), 1, anon_sym_DOT, + ACTIONS(114), 1, + sym__ident_regex, + ACTIONS(117), 1, + sym__comment, + ACTIONS(108), 2, aux_sym_connection_token1, aux_sym_connection_token2, + ACTIONS(111), 2, aux_sym_connection_token3, aux_sym_connection_token4, - sym_connection_identifier, - sym__ident_regex, - sym__comment, - [68] = 6, - ACTIONS(21), 1, - anon_sym_COLON, - ACTIONS(110), 1, - ts_builtin_sym_end, - ACTIONS(116), 1, - sym_connection_identifier, - STATE(21), 1, - sym_label, - ACTIONS(114), 2, - aux_sym_expression_token1, - anon_sym_SEMI, - ACTIONS(112), 9, + STATE(8), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + STATE(9), 2, + sym_expression, + aux_sym_source_file_repeat1, + STATE(2), 3, + sym_identifier, + sym_connection, + aux_sym_expression_repeat1, + [68] = 11, + ACTIONS(5), 1, anon_sym_LPAREN, + ACTIONS(7), 1, anon_sym_DASH, + ACTIONS(9), 1, anon_sym_DOT, + ACTIONS(15), 1, + sym__ident_regex, + ACTIONS(120), 1, + ts_builtin_sym_end, + ACTIONS(122), 1, + sym__comment, + ACTIONS(11), 2, aux_sym_connection_token1, aux_sym_connection_token2, + ACTIONS(13), 2, aux_sym_connection_token3, aux_sym_connection_token4, - sym__ident_regex, - sym__comment, - [96] = 2, - ACTIONS(118), 1, + STATE(8), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + STATE(9), 2, + sym_expression, + aux_sym_source_file_repeat1, + STATE(2), 3, + sym_identifier, + sym_connection, + aux_sym_expression_repeat1, + [108] = 5, + ACTIONS(124), 1, ts_builtin_sym_end, - ACTIONS(120), 14, + ACTIONS(131), 1, + anon_sym_DOT, + ACTIONS(128), 2, + anon_sym_DASH, + sym__ident_regex, + STATE(11), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + ACTIONS(126), 11, anon_sym_COLON, anon_sym_LPAREN, anon_sym_RPAREN, aux_sym_expression_token1, anon_sym_SEMI, - anon_sym_DASH, - anon_sym_DOT, aux_sym_connection_token1, aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, sym_connection_identifier, - sym__ident_regex, sym__comment, - [116] = 5, - ACTIONS(21), 1, - anon_sym_COLON, - ACTIONS(110), 1, - ts_builtin_sym_end, - STATE(21), 1, - sym_label, - ACTIONS(114), 2, - aux_sym_expression_token1, - anon_sym_SEMI, - ACTIONS(112), 9, + [136] = 10, + ACTIONS(134), 1, anon_sym_LPAREN, + ACTIONS(137), 1, + anon_sym_RBRACE, + ACTIONS(139), 1, anon_sym_DASH, + ACTIONS(142), 1, anon_sym_DOT, + ACTIONS(151), 1, + sym__ident_regex, + ACTIONS(145), 2, aux_sym_connection_token1, aux_sym_connection_token2, + ACTIONS(148), 2, aux_sym_connection_token3, aux_sym_connection_token4, - sym__ident_regex, - sym__comment, - [141] = 5, - ACTIONS(21), 1, - anon_sym_COLON, - ACTIONS(122), 1, - ts_builtin_sym_end, - STATE(23), 1, - sym_label, - ACTIONS(126), 2, - aux_sym_expression_token1, - anon_sym_SEMI, - ACTIONS(124), 9, - anon_sym_LPAREN, + STATE(12), 2, + sym_expression, + aux_sym_container_repeat1, + STATE(18), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + STATE(4), 3, + sym_identifier, + sym_connection, + aux_sym_expression_repeat1, + [173] = 10, + ACTIONS(47), 1, anon_sym_DASH, + ACTIONS(49), 1, anon_sym_DOT, + ACTIONS(154), 1, + anon_sym_LPAREN, + ACTIONS(156), 1, + anon_sym_RBRACE, + ACTIONS(158), 1, + sym__ident_regex, + ACTIONS(51), 2, aux_sym_connection_token1, aux_sym_connection_token2, + ACTIONS(53), 2, aux_sym_connection_token3, aux_sym_connection_token4, - sym__ident_regex, - sym__comment, - [166] = 5, - ACTIONS(21), 1, - anon_sym_COLON, - ACTIONS(128), 1, - ts_builtin_sym_end, - STATE(24), 1, - sym_label, - ACTIONS(132), 2, - aux_sym_expression_token1, - anon_sym_SEMI, - ACTIONS(130), 9, - anon_sym_LPAREN, + STATE(16), 2, + sym_expression, + aux_sym_container_repeat1, + STATE(18), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + STATE(4), 3, + sym_identifier, + sym_connection, + aux_sym_expression_repeat1, + [210] = 10, + ACTIONS(47), 1, anon_sym_DASH, + ACTIONS(49), 1, anon_sym_DOT, + ACTIONS(154), 1, + anon_sym_LPAREN, + ACTIONS(158), 1, + sym__ident_regex, + ACTIONS(160), 1, + anon_sym_RBRACE, + ACTIONS(51), 2, aux_sym_connection_token1, aux_sym_connection_token2, + ACTIONS(53), 2, aux_sym_connection_token3, aux_sym_connection_token4, + STATE(12), 2, + sym_expression, + aux_sym_container_repeat1, + STATE(18), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + STATE(4), 3, + sym_identifier, + sym_connection, + aux_sym_expression_repeat1, + [247] = 4, + ACTIONS(165), 1, + anon_sym_DOT, + ACTIONS(162), 2, + anon_sym_DASH, sym__ident_regex, - sym__comment, - [191] = 2, - ACTIONS(134), 1, - ts_builtin_sym_end, - ACTIONS(136), 11, + STATE(15), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + ACTIONS(126), 11, + anon_sym_COLON, anon_sym_LPAREN, + anon_sym_RPAREN, aux_sym_expression_token1, anon_sym_SEMI, - anon_sym_DASH, - anon_sym_DOT, + anon_sym_RBRACE, aux_sym_connection_token1, aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, - sym__ident_regex, - sym__comment, - [208] = 7, - ACTIONS(7), 1, + sym_connection_identifier, + [272] = 10, + ACTIONS(47), 1, anon_sym_DASH, - ACTIONS(9), 1, + ACTIONS(49), 1, anon_sym_DOT, - ACTIONS(15), 1, + ACTIONS(154), 1, + anon_sym_LPAREN, + ACTIONS(158), 1, sym__ident_regex, - ACTIONS(11), 2, + ACTIONS(168), 1, + anon_sym_RBRACE, + ACTIONS(51), 2, aux_sym_connection_token1, aux_sym_connection_token2, - ACTIONS(13), 2, + ACTIONS(53), 2, aux_sym_connection_token3, aux_sym_connection_token4, - STATE(6), 2, + STATE(12), 2, + sym_expression, + aux_sym_container_repeat1, + STATE(18), 2, sym_sub_identifier, aux_sym_identifier_repeat1, - STATE(3), 3, + STATE(4), 3, sym_identifier, sym_connection, aux_sym_expression_repeat1, - [235] = 3, - ACTIONS(110), 1, + [309] = 3, + ACTIONS(170), 1, ts_builtin_sym_end, - ACTIONS(114), 2, + ACTIONS(174), 1, + aux_sym_connection_token5, + ACTIONS(172), 14, + anon_sym_COLON, + anon_sym_LPAREN, + anon_sym_RPAREN, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(112), 9, - anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, + sym_connection_identifier, sym__ident_regex, sym__comment, - [254] = 3, - ACTIONS(122), 1, - ts_builtin_sym_end, - ACTIONS(126), 2, + [332] = 4, + ACTIONS(49), 1, + anon_sym_DOT, + ACTIONS(176), 2, + anon_sym_DASH, + sym__ident_regex, + STATE(15), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + ACTIONS(93), 11, + anon_sym_COLON, + anon_sym_LPAREN, + anon_sym_RPAREN, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(124), 9, - anon_sym_LPAREN, - anon_sym_DASH, - anon_sym_DOT, + anon_sym_RBRACE, aux_sym_connection_token1, aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, - sym__ident_regex, - sym__comment, - [273] = 3, - ACTIONS(31), 1, - ts_builtin_sym_end, - ACTIONS(37), 2, - aux_sym_expression_token1, - anon_sym_SEMI, - ACTIONS(33), 9, - anon_sym_LPAREN, + sym_connection_identifier, + [357] = 10, + ACTIONS(47), 1, + anon_sym_DASH, + ACTIONS(49), 1, + anon_sym_DOT, + ACTIONS(154), 1, + anon_sym_LPAREN, + ACTIONS(158), 1, + sym__ident_regex, + ACTIONS(178), 1, + anon_sym_RBRACE, + ACTIONS(51), 2, + aux_sym_connection_token1, + aux_sym_connection_token2, + ACTIONS(53), 2, + aux_sym_connection_token3, + aux_sym_connection_token4, + STATE(14), 2, + sym_expression, + aux_sym_container_repeat1, + STATE(18), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + STATE(4), 3, + sym_identifier, + sym_connection, + aux_sym_expression_repeat1, + [394] = 2, + ACTIONS(170), 1, + ts_builtin_sym_end, + ACTIONS(172), 14, + anon_sym_COLON, + anon_sym_LPAREN, + anon_sym_RPAREN, + aux_sym_expression_token1, + anon_sym_SEMI, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, + sym_connection_identifier, sym__ident_regex, sym__comment, - [292] = 3, - ACTIONS(128), 1, + [414] = 2, + ACTIONS(180), 1, ts_builtin_sym_end, - ACTIONS(132), 2, + ACTIONS(182), 14, + anon_sym_COLON, + anon_sym_LPAREN, + anon_sym_RPAREN, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(130), 9, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym_connection_identifier, + sym__ident_regex, + sym__comment, + [434] = 6, + ACTIONS(21), 1, + anon_sym_COLON, + ACTIONS(31), 1, + ts_builtin_sym_end, + ACTIONS(39), 1, + sym_connection_identifier, + STATE(43), 1, + sym_label_block, + ACTIONS(37), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(33), 9, anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, @@ -2091,13 +2297,37 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token4, sym__ident_regex, sym__comment, - [311] = 3, - ACTIONS(138), 1, + [462] = 2, + ACTIONS(184), 1, + aux_sym_connection_token5, + ACTIONS(172), 14, + anon_sym_COLON, + anon_sym_LPAREN, + anon_sym_RPAREN, + aux_sym_expression_token1, + anon_sym_SEMI, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym_connection_identifier, + sym__ident_regex, + [482] = 6, + ACTIONS(21), 1, + anon_sym_COLON, + ACTIONS(186), 1, ts_builtin_sym_end, - ACTIONS(142), 2, + ACTIONS(192), 1, + sym_connection_identifier, + STATE(46), 1, + sym_label_block, + ACTIONS(190), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(140), 9, + ACTIONS(188), 9, anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, @@ -2107,11 +2337,67 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token4, sym__ident_regex, sym__comment, - [330] = 2, - ACTIONS(110), 2, + [510] = 2, + ACTIONS(194), 1, ts_builtin_sym_end, + ACTIONS(196), 14, + anon_sym_COLON, + anon_sym_LPAREN, + anon_sym_RPAREN, + aux_sym_expression_token1, + anon_sym_SEMI, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym_connection_identifier, + sym__ident_regex, + sym__comment, + [530] = 1, + ACTIONS(196), 14, + anon_sym_COLON, + anon_sym_LPAREN, + anon_sym_RPAREN, + aux_sym_expression_token1, + anon_sym_SEMI, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym_connection_identifier, + sym__ident_regex, + [547] = 1, + ACTIONS(182), 14, + anon_sym_COLON, + anon_sym_LPAREN, + anon_sym_RPAREN, + aux_sym_expression_token1, + anon_sym_SEMI, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym_connection_identifier, sym__ident_regex, - ACTIONS(112), 8, + [564] = 5, + ACTIONS(21), 1, + anon_sym_COLON, + ACTIONS(186), 1, + ts_builtin_sym_end, + STATE(46), 1, + sym_label_block, + ACTIONS(190), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(188), 9, anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, @@ -2119,12 +2405,95 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, + sym__ident_regex, sym__comment, - [345] = 2, - ACTIONS(31), 2, + [589] = 5, + ACTIONS(41), 1, + anon_sym_COLON, + ACTIONS(61), 1, + sym_connection_identifier, + STATE(47), 1, + sym_label_block, + ACTIONS(59), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(33), 9, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [614] = 1, + ACTIONS(172), 14, + anon_sym_COLON, + anon_sym_LPAREN, + anon_sym_RPAREN, + aux_sym_expression_token1, + anon_sym_SEMI, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym_connection_identifier, + sym__ident_regex, + [631] = 5, + ACTIONS(21), 1, + anon_sym_COLON, + ACTIONS(198), 1, ts_builtin_sym_end, + STATE(40), 1, + sym_label_block, + ACTIONS(202), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(200), 9, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, sym__ident_regex, - ACTIONS(33), 8, + sym__comment, + [656] = 5, + ACTIONS(41), 1, + anon_sym_COLON, + ACTIONS(206), 1, + sym_connection_identifier, + STATE(52), 1, + sym_label_block, + ACTIONS(204), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(188), 9, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [681] = 5, + ACTIONS(21), 1, + anon_sym_COLON, + ACTIONS(208), 1, + ts_builtin_sym_end, + STATE(37), 1, + sym_label_block, + ACTIONS(212), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(210), 9, anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, @@ -2132,25 +2501,367 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, + sym__ident_regex, sym__comment, - [360] = 2, - ACTIONS(122), 2, + [706] = 4, + ACTIONS(41), 1, + anon_sym_COLON, + STATE(48), 1, + sym_label_block, + ACTIONS(214), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(200), 9, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [728] = 4, + ACTIONS(41), 1, + anon_sym_COLON, + STATE(54), 1, + sym_label_block, + ACTIONS(216), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(210), 9, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [750] = 4, + ACTIONS(41), 1, + anon_sym_COLON, + STATE(52), 1, + sym_label_block, + ACTIONS(204), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(188), 9, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [772] = 3, + ACTIONS(218), 1, ts_builtin_sym_end, + ACTIONS(222), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(220), 9, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [791] = 7, + ACTIONS(47), 1, + anon_sym_DASH, + ACTIONS(49), 1, + anon_sym_DOT, + ACTIONS(158), 1, sym__ident_regex, - ACTIONS(124), 8, + ACTIONS(51), 2, + aux_sym_connection_token1, + aux_sym_connection_token2, + ACTIONS(53), 2, + aux_sym_connection_token3, + aux_sym_connection_token4, + STATE(18), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + STATE(5), 3, + sym_identifier, + sym_connection, + aux_sym_expression_repeat1, + [818] = 2, + ACTIONS(224), 1, + ts_builtin_sym_end, + ACTIONS(226), 11, anon_sym_LPAREN, + aux_sym_expression_token1, + anon_sym_SEMI, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, + sym__ident_regex, sym__comment, - [375] = 2, - ACTIONS(128), 2, + [835] = 3, + ACTIONS(208), 1, ts_builtin_sym_end, + ACTIONS(212), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(210), 9, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, sym__ident_regex, - ACTIONS(130), 8, + sym__comment, + [854] = 7, + ACTIONS(7), 1, + anon_sym_DASH, + ACTIONS(9), 1, + anon_sym_DOT, + ACTIONS(15), 1, + sym__ident_regex, + ACTIONS(11), 2, + aux_sym_connection_token1, + aux_sym_connection_token2, + ACTIONS(13), 2, + aux_sym_connection_token3, + aux_sym_connection_token4, + STATE(8), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + STATE(3), 3, + sym_identifier, + sym_connection, + aux_sym_expression_repeat1, + [881] = 3, + ACTIONS(31), 1, + ts_builtin_sym_end, + ACTIONS(37), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(33), 9, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [900] = 3, + ACTIONS(186), 1, + ts_builtin_sym_end, + ACTIONS(190), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(188), 9, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [919] = 2, + ACTIONS(228), 1, + ts_builtin_sym_end, + ACTIONS(230), 11, + anon_sym_LPAREN, + aux_sym_expression_token1, + anon_sym_SEMI, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [936] = 2, + ACTIONS(232), 1, + ts_builtin_sym_end, + ACTIONS(234), 11, + anon_sym_LPAREN, + aux_sym_expression_token1, + anon_sym_SEMI, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [953] = 3, + ACTIONS(198), 1, + ts_builtin_sym_end, + ACTIONS(202), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(200), 9, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [972] = 2, + ACTIONS(204), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(188), 9, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [988] = 2, + ACTIONS(216), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(210), 9, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [1004] = 1, + ACTIONS(226), 11, + anon_sym_LPAREN, + aux_sym_expression_token1, + anon_sym_SEMI, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [1018] = 1, + ACTIONS(234), 11, + anon_sym_LPAREN, + aux_sym_expression_token1, + anon_sym_SEMI, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [1032] = 1, + ACTIONS(230), 11, + anon_sym_LPAREN, + aux_sym_expression_token1, + anon_sym_SEMI, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [1046] = 2, + ACTIONS(214), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(200), 9, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [1062] = 2, + ACTIONS(59), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(33), 9, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [1078] = 2, + ACTIONS(236), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(220), 9, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [1094] = 2, + ACTIONS(238), 2, + ts_builtin_sym_end, + sym__ident_regex, + ACTIONS(240), 8, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__comment, + [1109] = 2, + ACTIONS(186), 2, + ts_builtin_sym_end, + sym__ident_regex, + ACTIONS(188), 8, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__comment, + [1124] = 2, + ACTIONS(218), 2, + ts_builtin_sym_end, + sym__ident_regex, + ACTIONS(220), 8, anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, @@ -2159,11 +2870,11 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__comment, - [390] = 2, - ACTIONS(138), 2, + [1139] = 2, + ACTIONS(198), 2, ts_builtin_sym_end, sym__ident_regex, - ACTIONS(140), 8, + ACTIONS(200), 8, anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, @@ -2172,11 +2883,11 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__comment, - [405] = 2, - ACTIONS(144), 2, + [1154] = 2, + ACTIONS(208), 2, ts_builtin_sym_end, sym__ident_regex, - ACTIONS(146), 8, + ACTIONS(210), 8, anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, @@ -2185,151 +2896,370 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__comment, - [420] = 5, + [1169] = 2, + ACTIONS(31), 2, + ts_builtin_sym_end, + sym__ident_regex, + ACTIONS(33), 8, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__comment, + [1184] = 2, + ACTIONS(238), 1, + sym__ident_regex, + ACTIONS(240), 8, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + [1198] = 2, + ACTIONS(198), 1, + sym__ident_regex, + ACTIONS(200), 8, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + [1212] = 2, + ACTIONS(31), 1, + sym__ident_regex, + ACTIONS(33), 8, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + [1226] = 2, + ACTIONS(208), 1, + sym__ident_regex, + ACTIONS(210), 8, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + [1240] = 2, + ACTIONS(186), 1, + sym__ident_regex, + ACTIONS(188), 8, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + [1254] = 2, + ACTIONS(218), 1, + sym__ident_regex, + ACTIONS(220), 8, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + [1268] = 5, ACTIONS(7), 1, anon_sym_DASH, ACTIONS(9), 1, anon_sym_DOT, ACTIONS(15), 1, sym__ident_regex, - STATE(14), 1, + STATE(21), 1, sym_identifier, - STATE(6), 2, + STATE(8), 2, sym_sub_identifier, aux_sym_identifier_repeat1, - [437] = 2, - ACTIONS(148), 1, + [1285] = 5, + ACTIONS(47), 1, + anon_sym_DASH, + ACTIONS(49), 1, + anon_sym_DOT, + ACTIONS(158), 1, + sym__ident_regex, + STATE(27), 1, + sym_identifier, + STATE(18), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + [1302] = 3, + ACTIONS(242), 1, + anon_sym_LBRACE, + ACTIONS(244), 1, + sym_label, + STATE(51), 1, + sym_container, + [1312] = 3, + ACTIONS(246), 1, + anon_sym_LBRACE, + ACTIONS(248), 1, + sym_label, + STATE(44), 1, + sym_container, + [1322] = 2, + ACTIONS(250), 1, + anon_sym_DOT, + STATE(34), 1, + sym_sub_identifier, + [1329] = 2, + ACTIONS(252), 1, aux_sym_connection_token1, - ACTIONS(150), 1, + ACTIONS(254), 1, aux_sym_connection_token3, - [444] = 2, - ACTIONS(152), 1, + [1336] = 2, + ACTIONS(250), 1, anon_sym_DOT, - STATE(16), 1, + STATE(35), 1, sym_sub_identifier, - [451] = 2, - ACTIONS(152), 1, + [1343] = 2, + ACTIONS(256), 1, anon_sym_DOT, - STATE(17), 1, + STATE(33), 1, sym_sub_identifier, - [458] = 2, - ACTIONS(152), 1, + [1350] = 2, + ACTIONS(256), 1, anon_sym_DOT, - STATE(15), 1, + STATE(28), 1, sym_sub_identifier, - [465] = 1, - ACTIONS(154), 1, - aux_sym_label_token1, - [469] = 1, - ACTIONS(156), 1, + [1357] = 2, + ACTIONS(258), 1, + aux_sym_connection_token1, + ACTIONS(260), 1, + aux_sym_connection_token3, + [1364] = 2, + ACTIONS(256), 1, + anon_sym_DOT, + STATE(31), 1, + sym_sub_identifier, + [1371] = 2, + ACTIONS(250), 1, + anon_sym_DOT, + STATE(36), 1, + sym_sub_identifier, + [1378] = 1, + ACTIONS(262), 1, ts_builtin_sym_end, }; static const uint32_t ts_small_parse_table_map[] = { - [SMALL_STATE(10)] = 0, - [SMALL_STATE(11)] = 28, - [SMALL_STATE(12)] = 48, - [SMALL_STATE(13)] = 68, - [SMALL_STATE(14)] = 96, - [SMALL_STATE(15)] = 116, - [SMALL_STATE(16)] = 141, - [SMALL_STATE(17)] = 166, - [SMALL_STATE(18)] = 191, - [SMALL_STATE(19)] = 208, - [SMALL_STATE(20)] = 235, - [SMALL_STATE(21)] = 254, - [SMALL_STATE(22)] = 273, - [SMALL_STATE(23)] = 292, - [SMALL_STATE(24)] = 311, - [SMALL_STATE(25)] = 330, - [SMALL_STATE(26)] = 345, - [SMALL_STATE(27)] = 360, - [SMALL_STATE(28)] = 375, - [SMALL_STATE(29)] = 390, - [SMALL_STATE(30)] = 405, - [SMALL_STATE(31)] = 420, - [SMALL_STATE(32)] = 437, - [SMALL_STATE(33)] = 444, - [SMALL_STATE(34)] = 451, - [SMALL_STATE(35)] = 458, - [SMALL_STATE(36)] = 465, - [SMALL_STATE(37)] = 469, + [SMALL_STATE(8)] = 0, + [SMALL_STATE(9)] = 28, + [SMALL_STATE(10)] = 68, + [SMALL_STATE(11)] = 108, + [SMALL_STATE(12)] = 136, + [SMALL_STATE(13)] = 173, + [SMALL_STATE(14)] = 210, + [SMALL_STATE(15)] = 247, + [SMALL_STATE(16)] = 272, + [SMALL_STATE(17)] = 309, + [SMALL_STATE(18)] = 332, + [SMALL_STATE(19)] = 357, + [SMALL_STATE(20)] = 394, + [SMALL_STATE(21)] = 414, + [SMALL_STATE(22)] = 434, + [SMALL_STATE(23)] = 462, + [SMALL_STATE(24)] = 482, + [SMALL_STATE(25)] = 510, + [SMALL_STATE(26)] = 530, + [SMALL_STATE(27)] = 547, + [SMALL_STATE(28)] = 564, + [SMALL_STATE(29)] = 589, + [SMALL_STATE(30)] = 614, + [SMALL_STATE(31)] = 631, + [SMALL_STATE(32)] = 656, + [SMALL_STATE(33)] = 681, + [SMALL_STATE(34)] = 706, + [SMALL_STATE(35)] = 728, + [SMALL_STATE(36)] = 750, + [SMALL_STATE(37)] = 772, + [SMALL_STATE(38)] = 791, + [SMALL_STATE(39)] = 818, + [SMALL_STATE(40)] = 835, + [SMALL_STATE(41)] = 854, + [SMALL_STATE(42)] = 881, + [SMALL_STATE(43)] = 900, + [SMALL_STATE(44)] = 919, + [SMALL_STATE(45)] = 936, + [SMALL_STATE(46)] = 953, + [SMALL_STATE(47)] = 972, + [SMALL_STATE(48)] = 988, + [SMALL_STATE(49)] = 1004, + [SMALL_STATE(50)] = 1018, + [SMALL_STATE(51)] = 1032, + [SMALL_STATE(52)] = 1046, + [SMALL_STATE(53)] = 1062, + [SMALL_STATE(54)] = 1078, + [SMALL_STATE(55)] = 1094, + [SMALL_STATE(56)] = 1109, + [SMALL_STATE(57)] = 1124, + [SMALL_STATE(58)] = 1139, + [SMALL_STATE(59)] = 1154, + [SMALL_STATE(60)] = 1169, + [SMALL_STATE(61)] = 1184, + [SMALL_STATE(62)] = 1198, + [SMALL_STATE(63)] = 1212, + [SMALL_STATE(64)] = 1226, + [SMALL_STATE(65)] = 1240, + [SMALL_STATE(66)] = 1254, + [SMALL_STATE(67)] = 1268, + [SMALL_STATE(68)] = 1285, + [SMALL_STATE(69)] = 1302, + [SMALL_STATE(70)] = 1312, + [SMALL_STATE(71)] = 1322, + [SMALL_STATE(72)] = 1329, + [SMALL_STATE(73)] = 1336, + [SMALL_STATE(74)] = 1343, + [SMALL_STATE(75)] = 1350, + [SMALL_STATE(76)] = 1357, + [SMALL_STATE(77)] = 1364, + [SMALL_STATE(78)] = 1371, + [SMALL_STATE(79)] = 1378, }; 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_source_file, 0), - [5] = {.entry = {.count = 1, .reusable = false}}, SHIFT(19), - [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(6), - [9] = {.entry = {.count = 1, .reusable = false}}, SHIFT(31), - [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9), - [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(12), - [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), - [17] = {.entry = {.count = 1, .reusable = false}}, SHIFT(5), + [5] = {.entry = {.count = 1, .reusable = false}}, SHIFT(41), + [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), + [9] = {.entry = {.count = 1, .reusable = false}}, SHIFT(67), + [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(17), + [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(20), + [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), + [17] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10), [19] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 1), - [21] = {.entry = {.count = 1, .reusable = false}}, SHIFT(36), + [21] = {.entry = {.count = 1, .reusable = false}}, SHIFT(70), [23] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 1), - [25] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10), - [27] = {.entry = {.count = 1, .reusable = false}}, SHIFT(26), - [29] = {.entry = {.count = 1, .reusable = false}}, SHIFT(35), + [25] = {.entry = {.count = 1, .reusable = false}}, SHIFT(22), + [27] = {.entry = {.count = 1, .reusable = false}}, SHIFT(60), + [29] = {.entry = {.count = 1, .reusable = false}}, SHIFT(75), [31] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 2), [33] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 2), - [35] = {.entry = {.count = 1, .reusable = false}}, SHIFT(13), - [37] = {.entry = {.count = 1, .reusable = false}}, SHIFT(25), - [39] = {.entry = {.count = 1, .reusable = false}}, SHIFT(33), - [41] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_expression_repeat1, 2), - [43] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), - [45] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(6), - [48] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(31), - [51] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(9), - [54] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(12), - [57] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), - [59] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), - [61] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_identifier, 1), - [63] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_identifier, 1), - [65] = {.entry = {.count = 1, .reusable = false}}, SHIFT(7), - [67] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_identifier_repeat1, 2), - [69] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), - [71] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(7), - [74] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(31), - [77] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), - [79] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(19), - [82] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(6), - [85] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(31), - [88] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(9), - [91] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(12), - [94] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(6), - [97] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(8), - [100] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_connection, 1), - [102] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_connection, 1), - [104] = {.entry = {.count = 1, .reusable = false}}, SHIFT(32), - [106] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_connection, 3), - [108] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_connection, 3), - [110] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 3), - [112] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 3), - [114] = {.entry = {.count = 1, .reusable = false}}, SHIFT(27), - [116] = {.entry = {.count = 1, .reusable = false}}, SHIFT(34), - [118] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sub_identifier, 2), - [120] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sub_identifier, 2), - [122] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 4), - [124] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 4), - [126] = {.entry = {.count = 1, .reusable = false}}, SHIFT(28), - [128] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 5), - [130] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 5), - [132] = {.entry = {.count = 1, .reusable = false}}, SHIFT(29), - [134] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_label, 2), - [136] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_label, 2), - [138] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 6), - [140] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 6), - [142] = {.entry = {.count = 1, .reusable = false}}, SHIFT(30), - [144] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 7), - [146] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 7), - [148] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11), - [150] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), - [152] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), - [154] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), - [156] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [35] = {.entry = {.count = 1, .reusable = false}}, SHIFT(24), + [37] = {.entry = {.count = 1, .reusable = false}}, SHIFT(56), + [39] = {.entry = {.count = 1, .reusable = false}}, SHIFT(77), + [41] = {.entry = {.count = 1, .reusable = false}}, SHIFT(69), + [43] = {.entry = {.count = 1, .reusable = false}}, SHIFT(29), + [45] = {.entry = {.count = 1, .reusable = false}}, SHIFT(63), + [47] = {.entry = {.count = 1, .reusable = false}}, SHIFT(18), + [49] = {.entry = {.count = 1, .reusable = false}}, SHIFT(68), + [51] = {.entry = {.count = 1, .reusable = false}}, SHIFT(23), + [53] = {.entry = {.count = 1, .reusable = false}}, SHIFT(30), + [55] = {.entry = {.count = 1, .reusable = false}}, SHIFT(78), + [57] = {.entry = {.count = 1, .reusable = false}}, SHIFT(32), + [59] = {.entry = {.count = 1, .reusable = false}}, SHIFT(65), + [61] = {.entry = {.count = 1, .reusable = false}}, SHIFT(71), + [63] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_expression_repeat1, 2), + [65] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), + [67] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(8), + [70] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(67), + [73] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(17), + [76] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(20), + [79] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(18), + [82] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(68), + [85] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(23), + [88] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(30), + [91] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_identifier, 1), + [93] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_identifier, 1), + [95] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11), + [97] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), + [99] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(41), + [102] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(8), + [105] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(67), + [108] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(17), + [111] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(20), + [114] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(8), + [117] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(9), + [120] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), + [122] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9), + [124] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_identifier_repeat1, 2), + [126] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), + [128] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(11), + [131] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(67), + [134] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_container_repeat1, 2), SHIFT_REPEAT(38), + [137] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_container_repeat1, 2), + [139] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_container_repeat1, 2), SHIFT_REPEAT(18), + [142] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_container_repeat1, 2), SHIFT_REPEAT(68), + [145] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_container_repeat1, 2), SHIFT_REPEAT(23), + [148] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_container_repeat1, 2), SHIFT_REPEAT(30), + [151] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_container_repeat1, 2), SHIFT_REPEAT(18), + [154] = {.entry = {.count = 1, .reusable = false}}, SHIFT(38), + [156] = {.entry = {.count = 1, .reusable = false}}, SHIFT(50), + [158] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), + [160] = {.entry = {.count = 1, .reusable = false}}, SHIFT(39), + [162] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(15), + [165] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(68), + [168] = {.entry = {.count = 1, .reusable = false}}, SHIFT(49), + [170] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_connection, 1), + [172] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_connection, 1), + [174] = {.entry = {.count = 1, .reusable = false}}, SHIFT(72), + [176] = {.entry = {.count = 1, .reusable = false}}, SHIFT(15), + [178] = {.entry = {.count = 1, .reusable = false}}, SHIFT(45), + [180] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sub_identifier, 2), + [182] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sub_identifier, 2), + [184] = {.entry = {.count = 1, .reusable = false}}, SHIFT(76), + [186] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 3), + [188] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 3), + [190] = {.entry = {.count = 1, .reusable = false}}, SHIFT(58), + [192] = {.entry = {.count = 1, .reusable = false}}, SHIFT(74), + [194] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_connection, 3), + [196] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_connection, 3), + [198] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 4), + [200] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 4), + [202] = {.entry = {.count = 1, .reusable = false}}, SHIFT(59), + [204] = {.entry = {.count = 1, .reusable = false}}, SHIFT(62), + [206] = {.entry = {.count = 1, .reusable = false}}, SHIFT(73), + [208] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 5), + [210] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 5), + [212] = {.entry = {.count = 1, .reusable = false}}, SHIFT(57), + [214] = {.entry = {.count = 1, .reusable = false}}, SHIFT(64), + [216] = {.entry = {.count = 1, .reusable = false}}, SHIFT(66), + [218] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 6), + [220] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 6), + [222] = {.entry = {.count = 1, .reusable = false}}, SHIFT(55), + [224] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_container, 3), + [226] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_container, 3), + [228] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_label_block, 2), + [230] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_label_block, 2), + [232] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_container, 2), + [234] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_container, 2), + [236] = {.entry = {.count = 1, .reusable = false}}, SHIFT(61), + [238] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 7), + [240] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 7), + [242] = {.entry = {.count = 1, .reusable = false}}, SHIFT(13), + [244] = {.entry = {.count = 1, .reusable = false}}, SHIFT(51), + [246] = {.entry = {.count = 1, .reusable = false}}, SHIFT(19), + [248] = {.entry = {.count = 1, .reusable = false}}, SHIFT(44), + [250] = {.entry = {.count = 1, .reusable = true}}, SHIFT(68), + [252] = {.entry = {.count = 1, .reusable = false}}, SHIFT(25), + [254] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), + [256] = {.entry = {.count = 1, .reusable = true}}, SHIFT(67), + [258] = {.entry = {.count = 1, .reusable = false}}, SHIFT(26), + [260] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), + [262] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), }; #ifdef __cplusplus diff --git a/test/corpus/connections.txt b/test/corpus/connections.txt index 8e4c696..f09e6e5 100644 --- a/test/corpus/connections.txt +++ b/test/corpus/connections.txt @@ -132,7 +132,8 @@ Read Replica 1 -- Read Replica 2: Kept in sync (identifier) (connection) (identifier) - (label))) + (label_block + (label)))) ==================||| Multiline shape @@ -182,7 +183,8 @@ Database -> S3: backup (identifier) (connection) (identifier) - (label)) + (label_block + (label))) (expression (identifier) (connection) @@ -191,7 +193,8 @@ Database -> S3: backup (identifier) (connection) (identifier) - (label))) + (label_block + (label)))) ==================||| Connections Chaining @@ -209,7 +212,8 @@ High Mem Instance -> EC2 <- High CPU Instance: Hosted By (identifier) (connection) (identifier) - (label))) + (label_block + (label)))) ==================||| Cycles @@ -233,7 +237,8 @@ Stage Four -> Stage One: repeat (identifier) (connection) (identifier) - (label))) + (label_block + (label)))) ==================||| Connection identifiers @@ -252,12 +257,14 @@ x -> y: hello (identifier) (connection) (identifier) - (label)) + (label_block + (label))) (expression (identifier) (connection) (identifier) - (label)) + (label_block + (label))) (expression (identifier) (connection) @@ -267,7 +274,8 @@ x -> y: hello (identifier (sub_identifier (identifier)))) - (label)) + (label_block + (label))) (expression (identifier) (connection) @@ -277,4 +285,5 @@ x -> y: hello (identifier (sub_identifier (identifier)))) - (label))) \ No newline at end of file + (label_block + (label)))) diff --git a/test/corpus/containers.txt b/test/corpus/containers.txt index 93afb1f..30df88e 100644 --- a/test/corpus/containers.txt +++ b/test/corpus/containers.txt @@ -11,7 +11,8 @@ Cloud.shape: cloud (identifier (sub_identifier (identifier))) - (label))) + (label_block + (label)))) ================== Container With Spaces @@ -49,4 +50,53 @@ apartment.Bedroom.Bathroom -> office.Spare Room.Bathroom: Portal (identifier (sub_identifier (identifier))))) - (label))) \ No newline at end of file + (label_block + (label)))) + +================== +Nested Syntax +================== + +clouds: { + aws: { + load_balancer -> api + api -> db + } + gcloud: { + auth -> db + } + + gcloud -> aws +} + +--- + +(source_file + (expression + (identifier) + (label_block + (container + (expression + (identifier) + (label_block + (container + (expression + (identifier) + (connection) + (identifier)) + (expression + (identifier) + (connection) + (identifier))))) + (expression + (identifier) + (label_block + (container + (expression + (identifier) + (connection) + (identifier))))) + (expression + (identifier) + (connection) + (identifier)))))) diff --git a/test/corpus/labels.txt b/test/corpus/labels.txt index 4e6d451..57a5491 100644 --- a/test/corpus/labels.txt +++ b/test/corpus/labels.txt @@ -10,7 +10,9 @@ Cloud: my cloud (source_file (expression (identifier) - (label)) + (label_block + (label))) (expression (identifier) - (label))) \ No newline at end of file + (label_block + (label)))) From 2221cb7c3cf5cb65b850b0c696eab1752897be08 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 17 Sep 2023 23:39:30 +0300 Subject: [PATCH 11/11] split tests --- grammar.js | 7 +- src/grammar.json | 66 +- src/node-types.json | 25 +- src/parser.c | 2485 ++++++++++++++++++----------- test/corpus/connections.txt | 161 +- test/corpus/connections_basic.txt | 133 ++ test/corpus/containers.txt | 55 +- test/corpus/labels.txt | 36 +- 8 files changed, 1797 insertions(+), 1171 deletions(-) create mode 100644 test/corpus/connections_basic.txt diff --git a/grammar.js b/grammar.js index 548636d..651592d 100644 --- a/grammar.js +++ b/grammar.js @@ -31,13 +31,14 @@ module.exports = grammar({ $.connection_identifier, $.sub_identifier )), - optional($.label_block), + optional(seq(":", optional($.label), optional($.container))), optional(choice(/\n+\s*/, ";")), )), label_block: $ => choice( - seq(":", $.label), - seq(":", $.container), + seq(":", optional($.label), optional($.container)), + // seq(":", $.container), + // seq(":", $.label), ), container: $ => seq("{", repeat($.expression), "}"), diff --git a/src/grammar.json b/src/grammar.json index 15a8b16..4801378 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -135,8 +135,37 @@ "type": "CHOICE", "members": [ { - "type": "SYMBOL", - "name": "label_block" + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": ":" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "label" + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "container" + }, + { + "type": "BLANK" + } + ] + } + ] }, { "type": "BLANK" @@ -178,21 +207,28 @@ "value": ":" }, { - "type": "SYMBOL", - "name": "label" - } - ] - }, - { - "type": "SEQ", - "members": [ - { - "type": "STRING", - "value": ":" + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "label" + }, + { + "type": "BLANK" + } + ] }, { - "type": "SYMBOL", - "name": "container" + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "container" + }, + { + "type": "BLANK" + } + ] } ] } diff --git a/src/node-types.json b/src/node-types.json index 9b4b557..492211b 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -35,12 +35,16 @@ "type": "connection_identifier", "named": true }, + { + "type": "container", + "named": true + }, { "type": "identifier", "named": true }, { - "type": "label_block", + "type": "label", "named": true }, { @@ -65,25 +69,6 @@ ] } }, - { - "type": "label_block", - "named": true, - "fields": {}, - "children": { - "multiple": false, - "required": true, - "types": [ - { - "type": "container", - "named": true - }, - { - "type": "label", - "named": true - } - ] - } - }, { "type": "source_file", "named": true, diff --git a/src/parser.c b/src/parser.c index 908cd28..505a866 100644 --- a/src/parser.c +++ b/src/parser.c @@ -6,14 +6,14 @@ #endif #define LANGUAGE_VERSION 14 -#define STATE_COUNT 80 +#define STATE_COUNT 102 #define LARGE_STATE_COUNT 8 -#define SYMBOL_COUNT 35 +#define SYMBOL_COUNT 34 #define ALIAS_COUNT 0 #define TOKEN_COUNT 24 #define EXTERNAL_TOKEN_COUNT 0 #define FIELD_COUNT 0 -#define MAX_ALIAS_SEQUENCE_LENGTH 7 +#define MAX_ALIAS_SEQUENCE_LENGTH 9 #define PRODUCTION_ID_COUNT 1 enum { @@ -42,15 +42,14 @@ enum { sym__comment = 23, sym_source_file = 24, sym_expression = 25, - sym_label_block = 26, - sym_container = 27, - sym_identifier = 28, - sym_sub_identifier = 29, - sym_connection = 30, - aux_sym_source_file_repeat1 = 31, - aux_sym_expression_repeat1 = 32, - aux_sym_container_repeat1 = 33, - aux_sym_identifier_repeat1 = 34, + sym_container = 26, + sym_identifier = 27, + sym_sub_identifier = 28, + sym_connection = 29, + aux_sym_source_file_repeat1 = 30, + aux_sym_expression_repeat1 = 31, + aux_sym_container_repeat1 = 32, + aux_sym_identifier_repeat1 = 33, }; static const char * const ts_symbol_names[] = { @@ -80,7 +79,6 @@ static const char * const ts_symbol_names[] = { [sym__comment] = "_comment", [sym_source_file] = "source_file", [sym_expression] = "expression", - [sym_label_block] = "label_block", [sym_container] = "container", [sym_identifier] = "identifier", [sym_sub_identifier] = "sub_identifier", @@ -118,7 +116,6 @@ static const TSSymbol ts_symbol_map[] = { [sym__comment] = sym__comment, [sym_source_file] = sym_source_file, [sym_expression] = sym_expression, - [sym_label_block] = sym_label_block, [sym_container] = sym_container, [sym_identifier] = sym_identifier, [sym_sub_identifier] = sym_sub_identifier, @@ -234,10 +231,6 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, - [sym_label_block] = { - .visible = true, - .named = true, - }, [sym_container] = { .visible = true, .named = true, @@ -285,85 +278,107 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [1] = 1, [2] = 2, [3] = 3, - [4] = 2, + [4] = 4, [5] = 3, - [6] = 6, - [7] = 6, + [6] = 2, + [7] = 4, [8] = 8, [9] = 9, [10] = 10, [11] = 11, [12] = 12, - [13] = 13, + [13] = 11, [14] = 14, - [15] = 11, - [16] = 14, - [17] = 17, - [18] = 8, - [19] = 13, + [15] = 15, + [16] = 16, + [17] = 16, + [18] = 9, + [19] = 14, [20] = 20, [21] = 21, [22] = 22, - [23] = 17, + [23] = 15, [24] = 24, [25] = 25, - [26] = 25, - [27] = 21, + [26] = 26, + [27] = 27, [28] = 28, - [29] = 22, - [30] = 20, - [31] = 31, + [29] = 29, + [30] = 21, + [31] = 28, [32] = 24, [33] = 33, - [34] = 31, - [35] = 33, - [36] = 28, + [34] = 22, + [35] = 25, + [36] = 36, [37] = 37, - [38] = 38, + [38] = 27, [39] = 39, [40] = 40, - [41] = 38, + [41] = 26, [42] = 42, - [43] = 43, - [44] = 44, - [45] = 45, - [46] = 46, - [47] = 43, - [48] = 40, - [49] = 39, - [50] = 45, - [51] = 44, - [52] = 46, + [43] = 20, + [44] = 37, + [45] = 39, + [46] = 29, + [47] = 33, + [48] = 48, + [49] = 36, + [50] = 50, + [51] = 51, + [52] = 40, [53] = 42, - [54] = 37, + [54] = 54, [55] = 55, [56] = 56, - [57] = 57, - [58] = 58, - [59] = 59, + [57] = 48, + [58] = 56, + [59] = 51, [60] = 60, - [61] = 55, - [62] = 58, - [63] = 60, - [64] = 59, - [65] = 56, - [66] = 57, - [67] = 67, - [68] = 67, - [69] = 69, - [70] = 69, - [71] = 71, - [72] = 72, - [73] = 73, - [74] = 73, + [61] = 61, + [62] = 62, + [63] = 63, + [64] = 50, + [65] = 65, + [66] = 66, + [67] = 55, + [68] = 66, + [69] = 62, + [70] = 54, + [71] = 61, + [72] = 60, + [73] = 65, + [74] = 63, [75] = 75, - [76] = 72, - [77] = 71, - [78] = 75, + [76] = 76, + [77] = 77, + [78] = 78, [79] = 79, + [80] = 80, + [81] = 81, + [82] = 82, + [83] = 81, + [84] = 75, + [85] = 79, + [86] = 77, + [87] = 76, + [88] = 82, + [89] = 80, + [90] = 78, + [91] = 91, + [92] = 91, + [93] = 93, + [94] = 94, + [95] = 95, + [96] = 94, + [97] = 95, + [98] = 98, + [99] = 93, + [100] = 98, + [101] = 101, }; -static inline bool sym__ident_regex_character_set_1(int32_t c) { +static inline bool sym_label_character_set_1(int32_t c) { return (c < 6576 ? (c < 2972 ? (c < 2185 @@ -877,7 +892,7 @@ static inline bool sym__ident_regex_character_set_1(int32_t c) { : c <= 67883))))))))))))))); } -static inline bool sym__ident_regex_character_set_2(int32_t c) { +static inline bool sym_label_character_set_2(int32_t c) { return (c < 6528 ? (c < 2969 ? (c < 2160 @@ -1396,14 +1411,14 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { eof = lexer->eof(lexer); switch (state) { case 0: - if (eof) ADVANCE(29); + if (eof) ADVANCE(30); if (lookahead == '#') ADVANCE(1); - if (lookahead == '(') ADVANCE(36); - if (lookahead == ')') ADVANCE(37); - if (lookahead == '-') ADVANCE(46); - if (lookahead == '.') ADVANCE(47); - if (lookahead == ':') ADVANCE(31); - if (lookahead == ';') ADVANCE(39); + if (lookahead == '(') ADVANCE(37); + if (lookahead == ')') ADVANCE(39); + if (lookahead == '-') ADVANCE(55); + if (lookahead == '.') ADVANCE(57); + if (lookahead == ':') ADVANCE(32); + if (lookahead == ';') ADVANCE(41); if (lookahead == '<') ADVANCE(6); if (lookahead == '[') ADVANCE(26); if (lookahead == '\\') ADVANCE(2); @@ -1411,48 +1426,55 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == 'l') ADVANCE(9); if (lookahead == 'r') ADVANCE(15); if (lookahead == 'u') ADVANCE(20); - if (lookahead == '{') ADVANCE(40); - if (lookahead == '}') ADVANCE(42); + if (lookahead == '{') ADVANCE(43); + if (lookahead == '}') ADVANCE(45); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') SKIP(0) END_STATE(); case 1: - if (lookahead == '\n') ADVANCE(58); + if (lookahead == '\n') ADVANCE(69); if (lookahead != 0) ADVANCE(1); END_STATE(); case 2: if (lookahead == '\n') ADVANCE(3); END_STATE(); case 3: - if (lookahead == '\n') ADVANCE(52); + if (lookahead == '\n') ADVANCE(63); if (lookahead == '\t' || lookahead == '\r' || - lookahead == ' ') ADVANCE(53); + lookahead == ' ') ADVANCE(64); END_STATE(); case 4: - if (lookahead == '\n') SKIP(4) - if (lookahead == '{') ADVANCE(41); + if (lookahead == '\n') ADVANCE(40); + if (lookahead == ' ') ADVANCE(49); + if (lookahead == '(') ADVANCE(38); + if (lookahead == '-') ADVANCE(56); + if (lookahead == '.') ADVANCE(58); + if (lookahead == ';') ADVANCE(42); + if (lookahead == '<') ADVANCE(51); + if (lookahead == '{') ADVANCE(44); + if (lookahead == '}') ADVANCE(46); if (lookahead == '\t' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(43); - if (lookahead != 0) ADVANCE(44); + lookahead == '\r') ADVANCE(49); + if (sym_label_character_set_1(lookahead)) ADVANCE(52); + if (lookahead != 0) ADVANCE(53); END_STATE(); case 5: - if (lookahead == ' ') ADVANCE(56); - if (lookahead == '-') ADVANCE(45); - if (lookahead == '.') ADVANCE(47); + if (lookahead == ' ') ADVANCE(67); + if (lookahead == '-') ADVANCE(54); + if (lookahead == '.') ADVANCE(57); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r') SKIP(5) - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(57); + if (sym_label_character_set_1(lookahead)) ADVANCE(68); END_STATE(); case 6: - if (lookahead == '-') ADVANCE(49); + if (lookahead == '-') ADVANCE(60); END_STATE(); case 7: - if (lookahead == ']') ADVANCE(54); + if (lookahead == ']') ADVANCE(65); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(7); END_STATE(); case 8: @@ -1484,25 +1506,25 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == 'i') ADVANCE(19); END_STATE(); case 17: - if (lookahead == 'n') ADVANCE(35); + if (lookahead == 'n') ADVANCE(36); END_STATE(); case 18: - if (lookahead == 'n') ADVANCE(30); + if (lookahead == 'n') ADVANCE(31); END_STATE(); case 19: if (lookahead == 'o') ADVANCE(18); END_STATE(); case 20: - if (lookahead == 'p') ADVANCE(32); + if (lookahead == 'p') ADVANCE(33); END_STATE(); case 21: if (lookahead == 'r') ADVANCE(10); END_STATE(); case 22: - if (lookahead == 't') ADVANCE(34); + if (lookahead == 't') ADVANCE(35); END_STATE(); case 23: - if (lookahead == 't') ADVANCE(33); + if (lookahead == 't') ADVANCE(34); END_STATE(); case 24: if (lookahead == 't') ADVANCE(16); @@ -1514,160 +1536,251 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (('0' <= lookahead && lookahead <= '9')) ADVANCE(7); END_STATE(); case 27: - if (eof) ADVANCE(29); - if (lookahead == '\n') ADVANCE(38); - if (lookahead == ' ') ADVANCE(55); + if (eof) ADVANCE(30); + if (lookahead == '\n') ADVANCE(40); + if (lookahead == ' ') ADVANCE(66); if (lookahead == '#') ADVANCE(1); - if (lookahead == '(') ADVANCE(36); - if (lookahead == ')') ADVANCE(37); - if (lookahead == '-') ADVANCE(46); - if (lookahead == '.') ADVANCE(47); - if (lookahead == ':') ADVANCE(31); - if (lookahead == ';') ADVANCE(39); + if (lookahead == '(') ADVANCE(37); + if (lookahead == ')') ADVANCE(39); + if (lookahead == '-') ADVANCE(55); + if (lookahead == '.') ADVANCE(57); + if (lookahead == ':') ADVANCE(32); + if (lookahead == ';') ADVANCE(41); if (lookahead == '<') ADVANCE(6); if (lookahead == '[') ADVANCE(26); if (lookahead == '\\') ADVANCE(2); - if (lookahead == '}') ADVANCE(42); + if (lookahead == '{') ADVANCE(43); + if (lookahead == '}') ADVANCE(45); if (lookahead == '\t' || lookahead == '\r') SKIP(27) - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(57); + if (sym_label_character_set_1(lookahead)) ADVANCE(68); END_STATE(); case 28: - if (eof) ADVANCE(29); - if (lookahead == ' ') ADVANCE(56); + if (eof) ADVANCE(30); + if (lookahead == '\n') ADVANCE(40); + if (lookahead == ' ') ADVANCE(48); + if (lookahead == '#') ADVANCE(47); + if (lookahead == '(') ADVANCE(38); + if (lookahead == '-') ADVANCE(56); + if (lookahead == '.') ADVANCE(58); + if (lookahead == ';') ADVANCE(42); + if (lookahead == '<') ADVANCE(51); + if (lookahead == '{') ADVANCE(44); + if (lookahead == '\t' || + lookahead == '\r') ADVANCE(48); + if (sym_label_character_set_1(lookahead)) ADVANCE(52); + if (lookahead != 0) ADVANCE(53); + END_STATE(); + case 29: + if (eof) ADVANCE(30); + if (lookahead == ' ') ADVANCE(67); if (lookahead == '#') ADVANCE(1); - if (lookahead == '(') ADVANCE(36); - if (lookahead == '-') ADVANCE(46); - if (lookahead == '.') ADVANCE(47); + if (lookahead == '(') ADVANCE(37); + if (lookahead == '-') ADVANCE(55); + if (lookahead == '.') ADVANCE(57); if (lookahead == '<') ADVANCE(6); - if (lookahead == '}') ADVANCE(42); + if (lookahead == '}') ADVANCE(45); if (lookahead == '\t' || lookahead == '\n' || - lookahead == '\r') SKIP(28) - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(57); + lookahead == '\r') SKIP(29) + if (sym_label_character_set_1(lookahead)) ADVANCE(68); END_STATE(); - case 29: + case 30: ACCEPT_TOKEN(ts_builtin_sym_end); END_STATE(); - case 30: + case 31: ACCEPT_TOKEN(anon_sym_direction); END_STATE(); - case 31: + case 32: ACCEPT_TOKEN(anon_sym_COLON); END_STATE(); - case 32: + case 33: ACCEPT_TOKEN(anon_sym_up); END_STATE(); - case 33: + case 34: ACCEPT_TOKEN(anon_sym_right); END_STATE(); - case 34: + case 35: ACCEPT_TOKEN(anon_sym_left); END_STATE(); - case 35: + case 36: ACCEPT_TOKEN(anon_sym_down); END_STATE(); - case 36: + case 37: ACCEPT_TOKEN(anon_sym_LPAREN); END_STATE(); - case 37: + case 38: + ACCEPT_TOKEN(anon_sym_LPAREN); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(53); + END_STATE(); + case 39: ACCEPT_TOKEN(anon_sym_RPAREN); END_STATE(); - case 38: + case 40: ACCEPT_TOKEN(aux_sym_expression_token1); - if (lookahead == '\n') ADVANCE(38); - if (lookahead == ' ') ADVANCE(38); + if (lookahead == '\n') ADVANCE(40); + if (lookahead == ' ') ADVANCE(40); if (lookahead == '\t' || - lookahead == '\r') ADVANCE(38); + lookahead == '\r') ADVANCE(40); END_STATE(); - case 39: + case 41: ACCEPT_TOKEN(anon_sym_SEMI); END_STATE(); - case 40: + case 42: + ACCEPT_TOKEN(anon_sym_SEMI); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(53); + END_STATE(); + case 43: ACCEPT_TOKEN(anon_sym_LBRACE); END_STATE(); - case 41: + case 44: ACCEPT_TOKEN(anon_sym_LBRACE); if (lookahead != 0 && - lookahead != '\n') ADVANCE(44); + lookahead != '\n') ADVANCE(53); END_STATE(); - case 42: + case 45: ACCEPT_TOKEN(anon_sym_RBRACE); END_STATE(); - case 43: + case 46: + ACCEPT_TOKEN(anon_sym_RBRACE); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(53); + END_STATE(); + case 47: + ACCEPT_TOKEN(sym_label); + if (lookahead == '\n') ADVANCE(69); + if (lookahead != 0) ADVANCE(47); + END_STATE(); + case 48: ACCEPT_TOKEN(sym_label); - if (lookahead == '{') ADVANCE(41); + if (lookahead == '\n') ADVANCE(40); + if (lookahead == ' ') ADVANCE(48); + if (lookahead == '#') ADVANCE(47); + if (lookahead == '(') ADVANCE(38); + if (lookahead == '-') ADVANCE(56); + if (lookahead == '.') ADVANCE(58); + if (lookahead == ';') ADVANCE(42); + if (lookahead == '<') ADVANCE(51); + if (lookahead == '{') ADVANCE(44); if (lookahead == '\t' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(43); + lookahead == '\r') ADVANCE(48); + if (sym_label_character_set_1(lookahead)) ADVANCE(52); + if (lookahead != 0) ADVANCE(53); + END_STATE(); + case 49: + ACCEPT_TOKEN(sym_label); + if (lookahead == '\n') ADVANCE(40); + if (lookahead == ' ') ADVANCE(49); + if (lookahead == '(') ADVANCE(38); + if (lookahead == '-') ADVANCE(56); + if (lookahead == '.') ADVANCE(58); + if (lookahead == ';') ADVANCE(42); + if (lookahead == '<') ADVANCE(51); + if (lookahead == '{') ADVANCE(44); + if (lookahead == '}') ADVANCE(46); + if (lookahead == '\t' || + lookahead == '\r') ADVANCE(49); + if (sym_label_character_set_1(lookahead)) ADVANCE(52); + if (lookahead != 0) ADVANCE(53); + END_STATE(); + case 50: + ACCEPT_TOKEN(sym_label); + if (lookahead == '-') ADVANCE(50); + if (lookahead == '>') ADVANCE(53); if (lookahead != 0 && - lookahead != '\n') ADVANCE(44); + lookahead != '\n') ADVANCE(53); END_STATE(); - case 44: + case 51: ACCEPT_TOKEN(sym_label); + if (lookahead == '-') ADVANCE(50); if (lookahead != 0 && - lookahead != '\n') ADVANCE(44); + lookahead != '\n') ADVANCE(53); END_STATE(); - case 45: + case 52: + ACCEPT_TOKEN(sym_label); + if (sym_label_character_set_2(lookahead)) ADVANCE(52); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(53); + END_STATE(); + case 53: + ACCEPT_TOKEN(sym_label); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(53); + END_STATE(); + case 54: ACCEPT_TOKEN(anon_sym_DASH); END_STATE(); - case 46: + case 55: ACCEPT_TOKEN(anon_sym_DASH); - if (lookahead == '-') ADVANCE(48); - if (lookahead == '>') ADVANCE(50); + if (lookahead == '-') ADVANCE(59); + if (lookahead == '>') ADVANCE(61); END_STATE(); - case 47: + case 56: + ACCEPT_TOKEN(anon_sym_DASH); + if (lookahead == '-') ADVANCE(50); + if (lookahead == '>') ADVANCE(53); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(53); + END_STATE(); + case 57: ACCEPT_TOKEN(anon_sym_DOT); END_STATE(); - case 48: + case 58: + ACCEPT_TOKEN(anon_sym_DOT); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(53); + END_STATE(); + case 59: ACCEPT_TOKEN(aux_sym_connection_token1); - if (lookahead == '-') ADVANCE(48); - if (lookahead == '>') ADVANCE(50); + if (lookahead == '-') ADVANCE(59); + if (lookahead == '>') ADVANCE(61); END_STATE(); - case 49: + case 60: ACCEPT_TOKEN(aux_sym_connection_token2); - if (lookahead == '-') ADVANCE(49); - if (lookahead == '>') ADVANCE(51); + if (lookahead == '-') ADVANCE(60); + if (lookahead == '>') ADVANCE(62); END_STATE(); - case 50: + case 61: ACCEPT_TOKEN(aux_sym_connection_token3); END_STATE(); - case 51: + case 62: ACCEPT_TOKEN(aux_sym_connection_token4); END_STATE(); - case 52: + case 63: ACCEPT_TOKEN(aux_sym_connection_token5); - if (lookahead == '\n') ADVANCE(52); + if (lookahead == '\n') ADVANCE(63); if (lookahead == '\t' || lookahead == '\r' || - lookahead == ' ') ADVANCE(53); + lookahead == ' ') ADVANCE(64); END_STATE(); - case 53: + case 64: ACCEPT_TOKEN(aux_sym_connection_token5); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || - lookahead == ' ') ADVANCE(53); + lookahead == ' ') ADVANCE(64); END_STATE(); - case 54: + case 65: ACCEPT_TOKEN(sym_connection_identifier); END_STATE(); - case 55: + case 66: ACCEPT_TOKEN(sym__ident_regex); - if (lookahead == '\n') ADVANCE(38); - if (lookahead == ' ') ADVANCE(55); - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(57); + if (lookahead == '\n') ADVANCE(40); + if (lookahead == ' ') ADVANCE(66); + if (sym_label_character_set_1(lookahead)) ADVANCE(68); END_STATE(); - case 56: + case 67: ACCEPT_TOKEN(sym__ident_regex); - if (lookahead == ' ') ADVANCE(56); - if (sym__ident_regex_character_set_1(lookahead)) ADVANCE(57); + if (lookahead == ' ') ADVANCE(67); + if (sym_label_character_set_1(lookahead)) ADVANCE(68); END_STATE(); - case 57: + case 68: ACCEPT_TOKEN(sym__ident_regex); - if (sym__ident_regex_character_set_2(lookahead)) ADVANCE(57); + if (sym_label_character_set_2(lookahead)) ADVANCE(68); END_STATE(); - case 58: + case 69: ACCEPT_TOKEN(sym__comment); END_STATE(); default: @@ -1677,49 +1790,49 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { static const TSLexMode ts_lex_modes[STATE_COUNT] = { [0] = {.lex_state = 0}, - [1] = {.lex_state = 28}, + [1] = {.lex_state = 29}, [2] = {.lex_state = 27}, [3] = {.lex_state = 27}, [4] = {.lex_state = 27}, [5] = {.lex_state = 27}, [6] = {.lex_state = 27}, [7] = {.lex_state = 27}, - [8] = {.lex_state = 27}, - [9] = {.lex_state = 28}, - [10] = {.lex_state = 28}, + [8] = {.lex_state = 29}, + [9] = {.lex_state = 27}, + [10] = {.lex_state = 29}, [11] = {.lex_state = 27}, - [12] = {.lex_state = 28}, - [13] = {.lex_state = 28}, - [14] = {.lex_state = 28}, + [12] = {.lex_state = 29}, + [13] = {.lex_state = 27}, + [14] = {.lex_state = 29}, [15] = {.lex_state = 27}, - [16] = {.lex_state = 28}, - [17] = {.lex_state = 27}, + [16] = {.lex_state = 29}, + [17] = {.lex_state = 29}, [18] = {.lex_state = 27}, - [19] = {.lex_state = 28}, - [20] = {.lex_state = 27}, + [19] = {.lex_state = 29}, + [20] = {.lex_state = 28}, [21] = {.lex_state = 27}, - [22] = {.lex_state = 27}, + [22] = {.lex_state = 28}, [23] = {.lex_state = 27}, [24] = {.lex_state = 27}, - [25] = {.lex_state = 27}, - [26] = {.lex_state = 27}, - [27] = {.lex_state = 27}, + [25] = {.lex_state = 28}, + [26] = {.lex_state = 28}, + [27] = {.lex_state = 28}, [28] = {.lex_state = 27}, [29] = {.lex_state = 27}, [30] = {.lex_state = 27}, [31] = {.lex_state = 27}, [32] = {.lex_state = 27}, [33] = {.lex_state = 27}, - [34] = {.lex_state = 27}, - [35] = {.lex_state = 27}, + [34] = {.lex_state = 4}, + [35] = {.lex_state = 4}, [36] = {.lex_state = 27}, [37] = {.lex_state = 27}, - [38] = {.lex_state = 28}, + [38] = {.lex_state = 4}, [39] = {.lex_state = 27}, [40] = {.lex_state = 27}, - [41] = {.lex_state = 28}, + [41] = {.lex_state = 4}, [42] = {.lex_state = 27}, - [43] = {.lex_state = 27}, + [43] = {.lex_state = 4}, [44] = {.lex_state = 27}, [45] = {.lex_state = 27}, [46] = {.lex_state = 27}, @@ -1731,31 +1844,53 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [52] = {.lex_state = 27}, [53] = {.lex_state = 27}, [54] = {.lex_state = 27}, - [55] = {.lex_state = 28}, - [56] = {.lex_state = 28}, - [57] = {.lex_state = 28}, - [58] = {.lex_state = 28}, - [59] = {.lex_state = 28}, - [60] = {.lex_state = 28}, - [61] = {.lex_state = 28}, - [62] = {.lex_state = 28}, - [63] = {.lex_state = 28}, - [64] = {.lex_state = 28}, - [65] = {.lex_state = 28}, - [66] = {.lex_state = 28}, - [67] = {.lex_state = 5}, - [68] = {.lex_state = 5}, - [69] = {.lex_state = 4}, - [70] = {.lex_state = 4}, - [71] = {.lex_state = 0}, - [72] = {.lex_state = 0}, - [73] = {.lex_state = 0}, - [74] = {.lex_state = 0}, - [75] = {.lex_state = 0}, - [76] = {.lex_state = 0}, - [77] = {.lex_state = 0}, - [78] = {.lex_state = 0}, - [79] = {.lex_state = 0}, + [55] = {.lex_state = 27}, + [56] = {.lex_state = 29}, + [57] = {.lex_state = 27}, + [58] = {.lex_state = 29}, + [59] = {.lex_state = 27}, + [60] = {.lex_state = 27}, + [61] = {.lex_state = 27}, + [62] = {.lex_state = 27}, + [63] = {.lex_state = 27}, + [64] = {.lex_state = 27}, + [65] = {.lex_state = 27}, + [66] = {.lex_state = 27}, + [67] = {.lex_state = 27}, + [68] = {.lex_state = 27}, + [69] = {.lex_state = 27}, + [70] = {.lex_state = 27}, + [71] = {.lex_state = 27}, + [72] = {.lex_state = 27}, + [73] = {.lex_state = 27}, + [74] = {.lex_state = 27}, + [75] = {.lex_state = 29}, + [76] = {.lex_state = 29}, + [77] = {.lex_state = 29}, + [78] = {.lex_state = 29}, + [79] = {.lex_state = 29}, + [80] = {.lex_state = 29}, + [81] = {.lex_state = 29}, + [82] = {.lex_state = 29}, + [83] = {.lex_state = 29}, + [84] = {.lex_state = 29}, + [85] = {.lex_state = 29}, + [86] = {.lex_state = 29}, + [87] = {.lex_state = 29}, + [88] = {.lex_state = 29}, + [89] = {.lex_state = 29}, + [90] = {.lex_state = 29}, + [91] = {.lex_state = 5}, + [92] = {.lex_state = 5}, + [93] = {.lex_state = 0}, + [94] = {.lex_state = 0}, + [95] = {.lex_state = 0}, + [96] = {.lex_state = 0}, + [97] = {.lex_state = 0}, + [98] = {.lex_state = 0}, + [99] = {.lex_state = 0}, + [100] = {.lex_state = 0}, + [101] = {.lex_state = 0}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { @@ -1783,14 +1918,14 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [sym__comment] = ACTIONS(1), }, [1] = { - [sym_source_file] = STATE(79), + [sym_source_file] = STATE(101), [sym_expression] = STATE(10), - [sym_identifier] = STATE(2), - [sym_sub_identifier] = STATE(8), - [sym_connection] = STATE(2), + [sym_identifier] = STATE(3), + [sym_sub_identifier] = STATE(11), + [sym_connection] = STATE(3), [aux_sym_source_file_repeat1] = STATE(10), - [aux_sym_expression_repeat1] = STATE(2), - [aux_sym_identifier_repeat1] = STATE(8), + [aux_sym_expression_repeat1] = STATE(3), + [aux_sym_identifier_repeat1] = STATE(11), [ts_builtin_sym_end] = ACTIONS(3), [anon_sym_LPAREN] = ACTIONS(5), [anon_sym_DASH] = ACTIONS(7), @@ -1803,193 +1938,189 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [sym__comment] = ACTIONS(17), }, [2] = { - [sym_label_block] = STATE(42), - [sym_identifier] = STATE(6), - [sym_sub_identifier] = STATE(8), - [sym_connection] = STATE(6), - [aux_sym_expression_repeat1] = STATE(6), - [aux_sym_identifier_repeat1] = STATE(8), + [sym_identifier] = STATE(2), + [sym_sub_identifier] = STATE(11), + [sym_connection] = STATE(2), + [aux_sym_expression_repeat1] = STATE(2), + [aux_sym_identifier_repeat1] = STATE(11), [ts_builtin_sym_end] = ACTIONS(19), [anon_sym_COLON] = ACTIONS(21), - [anon_sym_LPAREN] = ACTIONS(23), - [anon_sym_RPAREN] = ACTIONS(25), - [aux_sym_expression_token1] = ACTIONS(27), - [anon_sym_SEMI] = ACTIONS(27), + [anon_sym_LPAREN] = ACTIONS(21), + [anon_sym_RPAREN] = ACTIONS(21), + [aux_sym_expression_token1] = ACTIONS(21), + [anon_sym_SEMI] = ACTIONS(21), + [anon_sym_DASH] = ACTIONS(23), + [anon_sym_DOT] = ACTIONS(26), + [aux_sym_connection_token1] = ACTIONS(29), + [aux_sym_connection_token2] = ACTIONS(29), + [aux_sym_connection_token3] = ACTIONS(32), + [aux_sym_connection_token4] = ACTIONS(32), + [sym_connection_identifier] = ACTIONS(21), + [sym__ident_regex] = ACTIONS(23), + [sym__comment] = ACTIONS(21), + }, + [3] = { + [sym_identifier] = STATE(2), + [sym_sub_identifier] = STATE(11), + [sym_connection] = STATE(2), + [aux_sym_expression_repeat1] = STATE(2), + [aux_sym_identifier_repeat1] = STATE(11), + [ts_builtin_sym_end] = ACTIONS(35), + [anon_sym_COLON] = ACTIONS(37), + [anon_sym_LPAREN] = ACTIONS(39), + [anon_sym_RPAREN] = ACTIONS(41), + [aux_sym_expression_token1] = ACTIONS(43), + [anon_sym_SEMI] = ACTIONS(43), [anon_sym_DASH] = ACTIONS(7), [anon_sym_DOT] = ACTIONS(9), [aux_sym_connection_token1] = ACTIONS(11), [aux_sym_connection_token2] = ACTIONS(11), [aux_sym_connection_token3] = ACTIONS(13), [aux_sym_connection_token4] = ACTIONS(13), - [sym_connection_identifier] = ACTIONS(29), + [sym_connection_identifier] = ACTIONS(45), [sym__ident_regex] = ACTIONS(7), - [sym__comment] = ACTIONS(23), + [sym__comment] = ACTIONS(39), }, - [3] = { - [sym_label_block] = STATE(43), - [sym_identifier] = STATE(6), - [sym_sub_identifier] = STATE(8), - [sym_connection] = STATE(6), - [aux_sym_expression_repeat1] = STATE(6), - [aux_sym_identifier_repeat1] = STATE(8), - [ts_builtin_sym_end] = ACTIONS(31), - [anon_sym_COLON] = ACTIONS(21), - [anon_sym_LPAREN] = ACTIONS(33), - [anon_sym_RPAREN] = ACTIONS(35), - [aux_sym_expression_token1] = ACTIONS(37), - [anon_sym_SEMI] = ACTIONS(37), + [4] = { + [sym_identifier] = STATE(2), + [sym_sub_identifier] = STATE(11), + [sym_connection] = STATE(2), + [aux_sym_expression_repeat1] = STATE(2), + [aux_sym_identifier_repeat1] = STATE(11), + [ts_builtin_sym_end] = ACTIONS(47), + [anon_sym_COLON] = ACTIONS(49), + [anon_sym_LPAREN] = ACTIONS(51), + [anon_sym_RPAREN] = ACTIONS(53), + [aux_sym_expression_token1] = ACTIONS(55), + [anon_sym_SEMI] = ACTIONS(55), [anon_sym_DASH] = ACTIONS(7), [anon_sym_DOT] = ACTIONS(9), [aux_sym_connection_token1] = ACTIONS(11), [aux_sym_connection_token2] = ACTIONS(11), [aux_sym_connection_token3] = ACTIONS(13), [aux_sym_connection_token4] = ACTIONS(13), - [sym_connection_identifier] = ACTIONS(39), + [sym_connection_identifier] = ACTIONS(57), [sym__ident_regex] = ACTIONS(7), - [sym__comment] = ACTIONS(33), - }, - [4] = { - [sym_label_block] = STATE(53), - [sym_identifier] = STATE(7), - [sym_sub_identifier] = STATE(18), - [sym_connection] = STATE(7), - [aux_sym_expression_repeat1] = STATE(7), - [aux_sym_identifier_repeat1] = STATE(18), - [anon_sym_COLON] = ACTIONS(41), - [anon_sym_LPAREN] = ACTIONS(23), - [anon_sym_RPAREN] = ACTIONS(43), - [aux_sym_expression_token1] = ACTIONS(45), - [anon_sym_SEMI] = ACTIONS(45), - [anon_sym_RBRACE] = ACTIONS(23), - [anon_sym_DASH] = ACTIONS(47), - [anon_sym_DOT] = ACTIONS(49), - [aux_sym_connection_token1] = ACTIONS(51), - [aux_sym_connection_token2] = ACTIONS(51), - [aux_sym_connection_token3] = ACTIONS(53), - [aux_sym_connection_token4] = ACTIONS(53), - [sym_connection_identifier] = ACTIONS(55), - [sym__ident_regex] = ACTIONS(47), + [sym__comment] = ACTIONS(51), }, [5] = { - [sym_label_block] = STATE(47), - [sym_identifier] = STATE(7), - [sym_sub_identifier] = STATE(18), - [sym_connection] = STATE(7), - [aux_sym_expression_repeat1] = STATE(7), - [aux_sym_identifier_repeat1] = STATE(18), - [anon_sym_COLON] = ACTIONS(41), - [anon_sym_LPAREN] = ACTIONS(33), - [anon_sym_RPAREN] = ACTIONS(57), - [aux_sym_expression_token1] = ACTIONS(59), - [anon_sym_SEMI] = ACTIONS(59), - [anon_sym_RBRACE] = ACTIONS(33), - [anon_sym_DASH] = ACTIONS(47), - [anon_sym_DOT] = ACTIONS(49), - [aux_sym_connection_token1] = ACTIONS(51), - [aux_sym_connection_token2] = ACTIONS(51), - [aux_sym_connection_token3] = ACTIONS(53), - [aux_sym_connection_token4] = ACTIONS(53), - [sym_connection_identifier] = ACTIONS(61), - [sym__ident_regex] = ACTIONS(47), + [sym_identifier] = STATE(6), + [sym_sub_identifier] = STATE(13), + [sym_connection] = STATE(6), + [aux_sym_expression_repeat1] = STATE(6), + [aux_sym_identifier_repeat1] = STATE(13), + [anon_sym_COLON] = ACTIONS(59), + [anon_sym_LPAREN] = ACTIONS(39), + [anon_sym_RPAREN] = ACTIONS(61), + [aux_sym_expression_token1] = ACTIONS(63), + [anon_sym_SEMI] = ACTIONS(63), + [anon_sym_RBRACE] = ACTIONS(39), + [anon_sym_DASH] = ACTIONS(65), + [anon_sym_DOT] = ACTIONS(67), + [aux_sym_connection_token1] = ACTIONS(69), + [aux_sym_connection_token2] = ACTIONS(69), + [aux_sym_connection_token3] = ACTIONS(71), + [aux_sym_connection_token4] = ACTIONS(71), + [sym_connection_identifier] = ACTIONS(73), + [sym__ident_regex] = ACTIONS(65), }, [6] = { [sym_identifier] = STATE(6), - [sym_sub_identifier] = STATE(8), + [sym_sub_identifier] = STATE(13), [sym_connection] = STATE(6), [aux_sym_expression_repeat1] = STATE(6), - [aux_sym_identifier_repeat1] = STATE(8), - [ts_builtin_sym_end] = ACTIONS(63), - [anon_sym_COLON] = ACTIONS(65), - [anon_sym_LPAREN] = ACTIONS(65), - [anon_sym_RPAREN] = ACTIONS(65), - [aux_sym_expression_token1] = ACTIONS(65), - [anon_sym_SEMI] = ACTIONS(65), - [anon_sym_DASH] = ACTIONS(67), - [anon_sym_DOT] = ACTIONS(70), - [aux_sym_connection_token1] = ACTIONS(73), - [aux_sym_connection_token2] = ACTIONS(73), - [aux_sym_connection_token3] = ACTIONS(76), - [aux_sym_connection_token4] = ACTIONS(76), - [sym_connection_identifier] = ACTIONS(65), - [sym__ident_regex] = ACTIONS(67), - [sym__comment] = ACTIONS(65), + [aux_sym_identifier_repeat1] = STATE(13), + [anon_sym_COLON] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(21), + [anon_sym_RPAREN] = ACTIONS(21), + [aux_sym_expression_token1] = ACTIONS(21), + [anon_sym_SEMI] = ACTIONS(21), + [anon_sym_RBRACE] = ACTIONS(21), + [anon_sym_DASH] = ACTIONS(75), + [anon_sym_DOT] = ACTIONS(78), + [aux_sym_connection_token1] = ACTIONS(81), + [aux_sym_connection_token2] = ACTIONS(81), + [aux_sym_connection_token3] = ACTIONS(84), + [aux_sym_connection_token4] = ACTIONS(84), + [sym_connection_identifier] = ACTIONS(21), + [sym__ident_regex] = ACTIONS(75), }, [7] = { - [sym_identifier] = STATE(7), - [sym_sub_identifier] = STATE(18), - [sym_connection] = STATE(7), - [aux_sym_expression_repeat1] = STATE(7), - [aux_sym_identifier_repeat1] = STATE(18), - [anon_sym_COLON] = ACTIONS(65), - [anon_sym_LPAREN] = ACTIONS(65), - [anon_sym_RPAREN] = ACTIONS(65), - [aux_sym_expression_token1] = ACTIONS(65), - [anon_sym_SEMI] = ACTIONS(65), - [anon_sym_RBRACE] = ACTIONS(65), - [anon_sym_DASH] = ACTIONS(79), - [anon_sym_DOT] = ACTIONS(82), - [aux_sym_connection_token1] = ACTIONS(85), - [aux_sym_connection_token2] = ACTIONS(85), - [aux_sym_connection_token3] = ACTIONS(88), - [aux_sym_connection_token4] = ACTIONS(88), - [sym_connection_identifier] = ACTIONS(65), - [sym__ident_regex] = ACTIONS(79), + [sym_identifier] = STATE(6), + [sym_sub_identifier] = STATE(13), + [sym_connection] = STATE(6), + [aux_sym_expression_repeat1] = STATE(6), + [aux_sym_identifier_repeat1] = STATE(13), + [anon_sym_COLON] = ACTIONS(87), + [anon_sym_LPAREN] = ACTIONS(51), + [anon_sym_RPAREN] = ACTIONS(89), + [aux_sym_expression_token1] = ACTIONS(91), + [anon_sym_SEMI] = ACTIONS(91), + [anon_sym_RBRACE] = ACTIONS(51), + [anon_sym_DASH] = ACTIONS(65), + [anon_sym_DOT] = ACTIONS(67), + [aux_sym_connection_token1] = ACTIONS(69), + [aux_sym_connection_token2] = ACTIONS(69), + [aux_sym_connection_token3] = ACTIONS(71), + [aux_sym_connection_token4] = ACTIONS(71), + [sym_connection_identifier] = ACTIONS(93), + [sym__ident_regex] = ACTIONS(65), }, }; static const uint16_t ts_small_parse_table[] = { - [0] = 5, - ACTIONS(9), 1, - anon_sym_DOT, - ACTIONS(91), 1, + [0] = 11, + ACTIONS(95), 1, ts_builtin_sym_end, - ACTIONS(95), 2, - anon_sym_DASH, - sym__ident_regex, - STATE(11), 2, - sym_sub_identifier, - aux_sym_identifier_repeat1, - ACTIONS(93), 11, - anon_sym_COLON, - anon_sym_LPAREN, - anon_sym_RPAREN, - aux_sym_expression_token1, - anon_sym_SEMI, - aux_sym_connection_token1, - aux_sym_connection_token2, - aux_sym_connection_token3, - aux_sym_connection_token4, - sym_connection_identifier, - sym__comment, - [28] = 11, ACTIONS(97), 1, - ts_builtin_sym_end, - ACTIONS(99), 1, anon_sym_LPAREN, - ACTIONS(102), 1, + ACTIONS(100), 1, anon_sym_DASH, - ACTIONS(105), 1, + ACTIONS(103), 1, anon_sym_DOT, - ACTIONS(114), 1, + ACTIONS(112), 1, sym__ident_regex, - ACTIONS(117), 1, + ACTIONS(115), 1, sym__comment, - ACTIONS(108), 2, + ACTIONS(106), 2, aux_sym_connection_token1, aux_sym_connection_token2, - ACTIONS(111), 2, + ACTIONS(109), 2, aux_sym_connection_token3, aux_sym_connection_token4, STATE(8), 2, - sym_sub_identifier, - aux_sym_identifier_repeat1, - STATE(9), 2, sym_expression, aux_sym_source_file_repeat1, - STATE(2), 3, + STATE(11), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + STATE(3), 3, sym_identifier, sym_connection, aux_sym_expression_repeat1, + [40] = 5, + ACTIONS(118), 1, + ts_builtin_sym_end, + ACTIONS(125), 1, + anon_sym_DOT, + ACTIONS(122), 2, + anon_sym_DASH, + sym__ident_regex, + STATE(9), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + ACTIONS(120), 11, + anon_sym_COLON, + anon_sym_LPAREN, + anon_sym_RPAREN, + aux_sym_expression_token1, + anon_sym_SEMI, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym_connection_identifier, + sym__comment, [68] = 11, ACTIONS(5), 1, anon_sym_LPAREN, @@ -1999,9 +2130,9 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_DOT, ACTIONS(15), 1, sym__ident_regex, - ACTIONS(120), 1, + ACTIONS(128), 1, ts_builtin_sym_end, - ACTIONS(122), 1, + ACTIONS(130), 1, sym__comment, ACTIONS(11), 2, aux_sym_connection_token1, @@ -2010,27 +2141,27 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, STATE(8), 2, - sym_sub_identifier, - aux_sym_identifier_repeat1, - STATE(9), 2, sym_expression, aux_sym_source_file_repeat1, - STATE(2), 3, + STATE(11), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + STATE(3), 3, sym_identifier, sym_connection, aux_sym_expression_repeat1, [108] = 5, - ACTIONS(124), 1, - ts_builtin_sym_end, - ACTIONS(131), 1, + ACTIONS(9), 1, anon_sym_DOT, - ACTIONS(128), 2, + ACTIONS(132), 1, + ts_builtin_sym_end, + ACTIONS(136), 2, anon_sym_DASH, sym__ident_regex, - STATE(11), 2, + STATE(9), 2, sym_sub_identifier, aux_sym_identifier_repeat1, - ACTIONS(126), 11, + ACTIONS(134), 11, anon_sym_COLON, anon_sym_LPAREN, anon_sym_RPAREN, @@ -2043,96 +2174,42 @@ static const uint16_t ts_small_parse_table[] = { sym_connection_identifier, sym__comment, [136] = 10, - ACTIONS(134), 1, + ACTIONS(138), 1, anon_sym_LPAREN, - ACTIONS(137), 1, + ACTIONS(141), 1, anon_sym_RBRACE, - ACTIONS(139), 1, + ACTIONS(143), 1, anon_sym_DASH, - ACTIONS(142), 1, + ACTIONS(146), 1, anon_sym_DOT, - ACTIONS(151), 1, + ACTIONS(155), 1, sym__ident_regex, - ACTIONS(145), 2, + ACTIONS(149), 2, aux_sym_connection_token1, aux_sym_connection_token2, - ACTIONS(148), 2, + ACTIONS(152), 2, aux_sym_connection_token3, aux_sym_connection_token4, STATE(12), 2, sym_expression, aux_sym_container_repeat1, - STATE(18), 2, + STATE(13), 2, sym_sub_identifier, aux_sym_identifier_repeat1, - STATE(4), 3, + STATE(5), 3, sym_identifier, sym_connection, aux_sym_expression_repeat1, - [173] = 10, - ACTIONS(47), 1, - anon_sym_DASH, - ACTIONS(49), 1, + [173] = 4, + ACTIONS(67), 1, anon_sym_DOT, - ACTIONS(154), 1, - anon_sym_LPAREN, - ACTIONS(156), 1, - anon_sym_RBRACE, - ACTIONS(158), 1, - sym__ident_regex, - ACTIONS(51), 2, - aux_sym_connection_token1, - aux_sym_connection_token2, - ACTIONS(53), 2, - aux_sym_connection_token3, - aux_sym_connection_token4, - STATE(16), 2, - sym_expression, - aux_sym_container_repeat1, - STATE(18), 2, - sym_sub_identifier, - aux_sym_identifier_repeat1, - STATE(4), 3, - sym_identifier, - sym_connection, - aux_sym_expression_repeat1, - [210] = 10, - ACTIONS(47), 1, + ACTIONS(158), 2, anon_sym_DASH, - ACTIONS(49), 1, - anon_sym_DOT, - ACTIONS(154), 1, - anon_sym_LPAREN, - ACTIONS(158), 1, sym__ident_regex, - ACTIONS(160), 1, - anon_sym_RBRACE, - ACTIONS(51), 2, - aux_sym_connection_token1, - aux_sym_connection_token2, - ACTIONS(53), 2, - aux_sym_connection_token3, - aux_sym_connection_token4, - STATE(12), 2, - sym_expression, - aux_sym_container_repeat1, STATE(18), 2, sym_sub_identifier, aux_sym_identifier_repeat1, - STATE(4), 3, - sym_identifier, - sym_connection, - aux_sym_expression_repeat1, - [247] = 4, - ACTIONS(165), 1, - anon_sym_DOT, - ACTIONS(162), 2, - anon_sym_DASH, - sym__ident_regex, - STATE(15), 2, - sym_sub_identifier, - aux_sym_identifier_repeat1, - ACTIONS(126), 11, + ACTIONS(134), 11, anon_sym_COLON, anon_sym_LPAREN, anon_sym_RPAREN, @@ -2144,39 +2221,39 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym_connection_identifier, - [272] = 10, - ACTIONS(47), 1, + [198] = 10, + ACTIONS(65), 1, anon_sym_DASH, - ACTIONS(49), 1, + ACTIONS(67), 1, anon_sym_DOT, - ACTIONS(154), 1, + ACTIONS(160), 1, anon_sym_LPAREN, - ACTIONS(158), 1, - sym__ident_regex, - ACTIONS(168), 1, + ACTIONS(162), 1, anon_sym_RBRACE, - ACTIONS(51), 2, + ACTIONS(164), 1, + sym__ident_regex, + ACTIONS(69), 2, aux_sym_connection_token1, aux_sym_connection_token2, - ACTIONS(53), 2, + ACTIONS(71), 2, aux_sym_connection_token3, aux_sym_connection_token4, STATE(12), 2, sym_expression, aux_sym_container_repeat1, - STATE(18), 2, + STATE(13), 2, sym_sub_identifier, aux_sym_identifier_repeat1, - STATE(4), 3, + STATE(5), 3, sym_identifier, sym_connection, aux_sym_expression_repeat1, - [309] = 3, - ACTIONS(170), 1, + [235] = 3, + ACTIONS(166), 1, ts_builtin_sym_end, - ACTIONS(174), 1, + ACTIONS(170), 1, aux_sym_connection_token5, - ACTIONS(172), 14, + ACTIONS(168), 14, anon_sym_COLON, anon_sym_LPAREN, anon_sym_RPAREN, @@ -2191,58 +2268,134 @@ static const uint16_t ts_small_parse_table[] = { sym_connection_identifier, sym__ident_regex, sym__comment, - [332] = 4, - ACTIONS(49), 1, - anon_sym_DOT, - ACTIONS(176), 2, + [258] = 10, + ACTIONS(65), 1, anon_sym_DASH, - sym__ident_regex, - STATE(15), 2, - sym_sub_identifier, - aux_sym_identifier_repeat1, - ACTIONS(93), 11, - anon_sym_COLON, + ACTIONS(67), 1, + anon_sym_DOT, + ACTIONS(160), 1, anon_sym_LPAREN, - anon_sym_RPAREN, - aux_sym_expression_token1, - anon_sym_SEMI, + ACTIONS(164), 1, + sym__ident_regex, + ACTIONS(172), 1, anon_sym_RBRACE, + ACTIONS(69), 2, aux_sym_connection_token1, aux_sym_connection_token2, + ACTIONS(71), 2, aux_sym_connection_token3, aux_sym_connection_token4, - sym_connection_identifier, - [357] = 10, - ACTIONS(47), 1, + STATE(13), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + STATE(19), 2, + sym_expression, + aux_sym_container_repeat1, + STATE(5), 3, + sym_identifier, + sym_connection, + aux_sym_expression_repeat1, + [295] = 10, + ACTIONS(65), 1, anon_sym_DASH, - ACTIONS(49), 1, + ACTIONS(67), 1, anon_sym_DOT, - ACTIONS(154), 1, + ACTIONS(160), 1, anon_sym_LPAREN, - ACTIONS(158), 1, + ACTIONS(164), 1, sym__ident_regex, - ACTIONS(178), 1, + ACTIONS(174), 1, anon_sym_RBRACE, - ACTIONS(51), 2, + ACTIONS(69), 2, aux_sym_connection_token1, aux_sym_connection_token2, - ACTIONS(53), 2, + ACTIONS(71), 2, aux_sym_connection_token3, aux_sym_connection_token4, + STATE(13), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, STATE(14), 2, sym_expression, aux_sym_container_repeat1, + STATE(5), 3, + sym_identifier, + sym_connection, + aux_sym_expression_repeat1, + [332] = 4, + ACTIONS(179), 1, + anon_sym_DOT, + ACTIONS(176), 2, + anon_sym_DASH, + sym__ident_regex, STATE(18), 2, sym_sub_identifier, aux_sym_identifier_repeat1, - STATE(4), 3, + ACTIONS(120), 11, + anon_sym_COLON, + anon_sym_LPAREN, + anon_sym_RPAREN, + aux_sym_expression_token1, + anon_sym_SEMI, + anon_sym_RBRACE, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym_connection_identifier, + [357] = 10, + ACTIONS(65), 1, + anon_sym_DASH, + ACTIONS(67), 1, + anon_sym_DOT, + ACTIONS(160), 1, + anon_sym_LPAREN, + ACTIONS(164), 1, + sym__ident_regex, + ACTIONS(182), 1, + anon_sym_RBRACE, + ACTIONS(69), 2, + aux_sym_connection_token1, + aux_sym_connection_token2, + ACTIONS(71), 2, + aux_sym_connection_token3, + aux_sym_connection_token4, + STATE(12), 2, + sym_expression, + aux_sym_container_repeat1, + STATE(13), 2, + sym_sub_identifier, + aux_sym_identifier_repeat1, + STATE(5), 3, sym_identifier, sym_connection, aux_sym_expression_repeat1, - [394] = 2, - ACTIONS(170), 1, + [394] = 6, + ACTIONS(47), 1, ts_builtin_sym_end, - ACTIONS(172), 14, + ACTIONS(184), 1, + anon_sym_LBRACE, + ACTIONS(186), 1, + sym_label, + STATE(60), 1, + sym_container, + ACTIONS(55), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(51), 9, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [422] = 2, + ACTIONS(188), 1, + ts_builtin_sym_end, + ACTIONS(190), 14, anon_sym_COLON, anon_sym_LPAREN, anon_sym_RPAREN, @@ -2257,15 +2410,38 @@ static const uint16_t ts_small_parse_table[] = { sym_connection_identifier, sym__ident_regex, sym__comment, - [414] = 2, - ACTIONS(180), 1, + [442] = 6, + ACTIONS(184), 1, + anon_sym_LBRACE, + ACTIONS(192), 1, ts_builtin_sym_end, - ACTIONS(182), 14, + ACTIONS(198), 1, + sym_label, + STATE(54), 1, + sym_container, + ACTIONS(196), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(194), 9, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [470] = 2, + ACTIONS(200), 1, + aux_sym_connection_token5, + ACTIONS(168), 14, anon_sym_COLON, anon_sym_LPAREN, anon_sym_RPAREN, aux_sym_expression_token1, anon_sym_SEMI, + anon_sym_RBRACE, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, @@ -2274,20 +2450,37 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token4, sym_connection_identifier, sym__ident_regex, - sym__comment, - [434] = 6, - ACTIONS(21), 1, - anon_sym_COLON, - ACTIONS(31), 1, + [490] = 2, + ACTIONS(166), 1, ts_builtin_sym_end, - ACTIONS(39), 1, + ACTIONS(168), 14, + anon_sym_COLON, + anon_sym_LPAREN, + anon_sym_RPAREN, + aux_sym_expression_token1, + anon_sym_SEMI, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, sym_connection_identifier, - STATE(43), 1, - sym_label_block, - ACTIONS(37), 2, + sym__ident_regex, + sym__comment, + [510] = 6, + ACTIONS(184), 1, + anon_sym_LBRACE, + ACTIONS(202), 1, + ts_builtin_sym_end, + ACTIONS(208), 1, + sym_label, + STATE(55), 1, + sym_container, + ACTIONS(206), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(33), 9, + ACTIONS(204), 9, anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, @@ -2297,10 +2490,90 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token4, sym__ident_regex, sym__comment, - [462] = 2, + [538] = 6, ACTIONS(184), 1, - aux_sym_connection_token5, - ACTIONS(172), 14, + anon_sym_LBRACE, + ACTIONS(210), 1, + ts_builtin_sym_end, + ACTIONS(216), 1, + sym_label, + STATE(66), 1, + sym_container, + ACTIONS(214), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(212), 9, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [566] = 6, + ACTIONS(184), 1, + anon_sym_LBRACE, + ACTIONS(218), 1, + ts_builtin_sym_end, + ACTIONS(224), 1, + sym_label, + STATE(61), 1, + sym_container, + ACTIONS(222), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(220), 9, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [594] = 2, + ACTIONS(226), 1, + ts_builtin_sym_end, + ACTIONS(228), 14, + anon_sym_COLON, + anon_sym_LPAREN, + anon_sym_RPAREN, + aux_sym_expression_token1, + anon_sym_SEMI, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym_connection_identifier, + sym__ident_regex, + sym__comment, + [614] = 5, + ACTIONS(184), 1, + anon_sym_LBRACE, + ACTIONS(202), 1, + ts_builtin_sym_end, + STATE(55), 1, + sym_container, + ACTIONS(206), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(204), 9, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [639] = 1, + ACTIONS(190), 14, anon_sym_COLON, anon_sym_LPAREN, anon_sym_RPAREN, @@ -2315,19 +2588,129 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token4, sym_connection_identifier, sym__ident_regex, - [482] = 6, - ACTIONS(21), 1, + [656] = 1, + ACTIONS(228), 14, anon_sym_COLON, - ACTIONS(186), 1, + anon_sym_LPAREN, + anon_sym_RPAREN, + aux_sym_expression_token1, + anon_sym_SEMI, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym_connection_identifier, + sym__ident_regex, + [673] = 1, + ACTIONS(168), 14, + anon_sym_COLON, + anon_sym_LPAREN, + anon_sym_RPAREN, + aux_sym_expression_token1, + anon_sym_SEMI, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym_connection_identifier, + sym__ident_regex, + [690] = 5, + ACTIONS(47), 1, ts_builtin_sym_end, - ACTIONS(192), 1, + ACTIONS(49), 1, + anon_sym_COLON, + ACTIONS(57), 1, sym_connection_identifier, - STATE(46), 1, - sym_label_block, - ACTIONS(190), 2, + ACTIONS(55), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(51), 9, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [715] = 5, + ACTIONS(232), 1, + anon_sym_LBRACE, + ACTIONS(234), 1, + sym_label, + STATE(70), 1, + sym_container, + ACTIONS(230), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(194), 9, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [740] = 5, + ACTIONS(232), 1, + anon_sym_LBRACE, + ACTIONS(238), 1, + sym_label, + STATE(67), 1, + sym_container, + ACTIONS(236), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(204), 9, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [765] = 5, + ACTIONS(184), 1, + anon_sym_LBRACE, + ACTIONS(210), 1, + ts_builtin_sym_end, + STATE(66), 1, + sym_container, + ACTIONS(214), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(212), 9, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [790] = 5, + ACTIONS(184), 1, + anon_sym_LBRACE, + ACTIONS(240), 1, + ts_builtin_sym_end, + STATE(62), 1, + sym_container, + ACTIONS(244), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(188), 9, + ACTIONS(242), 9, anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, @@ -2337,31 +2720,136 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token4, sym__ident_regex, sym__comment, - [510] = 2, - ACTIONS(194), 1, + [815] = 5, + ACTIONS(232), 1, + anon_sym_LBRACE, + ACTIONS(248), 1, + sym_label, + STATE(71), 1, + sym_container, + ACTIONS(246), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(220), 9, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [840] = 5, + ACTIONS(184), 1, + anon_sym_LBRACE, + ACTIONS(218), 1, + ts_builtin_sym_end, + STATE(61), 1, + sym_container, + ACTIONS(222), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(220), 9, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [865] = 5, + ACTIONS(184), 1, + anon_sym_LBRACE, + ACTIONS(192), 1, ts_builtin_sym_end, - ACTIONS(196), 14, + STATE(54), 1, + sym_container, + ACTIONS(196), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(194), 9, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [890] = 5, + ACTIONS(232), 1, + anon_sym_LBRACE, + ACTIONS(252), 1, + sym_label, + STATE(68), 1, + sym_container, + ACTIONS(250), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(212), 9, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [915] = 5, + ACTIONS(202), 1, + ts_builtin_sym_end, + ACTIONS(254), 1, anon_sym_COLON, + ACTIONS(256), 1, + sym_connection_identifier, + ACTIONS(206), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(204), 9, anon_sym_LPAREN, - anon_sym_RPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [940] = 5, + ACTIONS(232), 1, + anon_sym_LBRACE, + ACTIONS(258), 1, + sym_label, + STATE(72), 1, + sym_container, + ACTIONS(91), 2, aux_sym_expression_token1, anon_sym_SEMI, + ACTIONS(51), 9, + anon_sym_LPAREN, + anon_sym_RBRACE, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, - sym_connection_identifier, sym__ident_regex, - sym__comment, - [530] = 1, - ACTIONS(196), 14, - anon_sym_COLON, - anon_sym_LPAREN, - anon_sym_RPAREN, + [965] = 4, + ACTIONS(232), 1, + anon_sym_LBRACE, + STATE(69), 1, + sym_container, + ACTIONS(260), 2, aux_sym_expression_token1, anon_sym_SEMI, + ACTIONS(242), 9, + anon_sym_LPAREN, anon_sym_RBRACE, anon_sym_DASH, anon_sym_DOT, @@ -2369,15 +2857,17 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, - sym_connection_identifier, sym__ident_regex, - [547] = 1, - ACTIONS(182), 14, - anon_sym_COLON, - anon_sym_LPAREN, - anon_sym_RPAREN, + [987] = 4, + ACTIONS(232), 1, + anon_sym_LBRACE, + STATE(71), 1, + sym_container, + ACTIONS(246), 2, aux_sym_expression_token1, anon_sym_SEMI, + ACTIONS(220), 9, + anon_sym_LPAREN, anon_sym_RBRACE, anon_sym_DASH, anon_sym_DOT, @@ -2385,20 +2875,18 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, - sym_connection_identifier, sym__ident_regex, - [564] = 5, - ACTIONS(21), 1, - anon_sym_COLON, - ACTIONS(186), 1, - ts_builtin_sym_end, - STATE(46), 1, - sym_label_block, - ACTIONS(190), 2, + [1009] = 4, + ACTIONS(232), 1, + anon_sym_LBRACE, + STATE(67), 1, + sym_container, + ACTIONS(236), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(188), 9, + ACTIONS(204), 9, anon_sym_LPAREN, + anon_sym_RBRACE, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, @@ -2406,18 +2894,15 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - sym__comment, - [589] = 5, - ACTIONS(41), 1, + [1031] = 4, + ACTIONS(87), 1, anon_sym_COLON, - ACTIONS(61), 1, + ACTIONS(93), 1, sym_connection_identifier, - STATE(47), 1, - sym_label_block, - ACTIONS(59), 2, + ACTIONS(91), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(33), 9, + ACTIONS(51), 9, anon_sym_LPAREN, anon_sym_RBRACE, anon_sym_DASH, @@ -2427,34 +2912,35 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [614] = 1, - ACTIONS(172), 14, + [1053] = 4, + ACTIONS(218), 1, + ts_builtin_sym_end, + ACTIONS(262), 1, anon_sym_COLON, - anon_sym_LPAREN, - anon_sym_RPAREN, + ACTIONS(222), 2, aux_sym_expression_token1, anon_sym_SEMI, - anon_sym_RBRACE, + ACTIONS(220), 9, + anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, - sym_connection_identifier, sym__ident_regex, - [631] = 5, - ACTIONS(21), 1, - anon_sym_COLON, - ACTIONS(198), 1, - ts_builtin_sym_end, - STATE(40), 1, - sym_label_block, - ACTIONS(202), 2, + sym__comment, + [1075] = 4, + ACTIONS(232), 1, + anon_sym_LBRACE, + STATE(68), 1, + sym_container, + ACTIONS(250), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(200), 9, + ACTIONS(212), 9, anon_sym_LPAREN, + anon_sym_RBRACE, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, @@ -2462,20 +2948,16 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - sym__comment, - [656] = 5, - ACTIONS(41), 1, + [1097] = 4, + ACTIONS(202), 1, + ts_builtin_sym_end, + ACTIONS(254), 1, anon_sym_COLON, - ACTIONS(206), 1, - sym_connection_identifier, - STATE(52), 1, - sym_label_block, - ACTIONS(204), 2, + ACTIONS(206), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(188), 9, + ACTIONS(204), 9, anon_sym_LPAREN, - anon_sym_RBRACE, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, @@ -2483,17 +2965,16 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [681] = 5, - ACTIONS(21), 1, - anon_sym_COLON, - ACTIONS(208), 1, + sym__comment, + [1119] = 4, + ACTIONS(210), 1, ts_builtin_sym_end, - STATE(37), 1, - sym_label_block, - ACTIONS(212), 2, + ACTIONS(264), 1, + anon_sym_COLON, + ACTIONS(214), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(210), 9, + ACTIONS(212), 9, anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, @@ -2503,15 +2984,15 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token4, sym__ident_regex, sym__comment, - [706] = 4, - ACTIONS(41), 1, - anon_sym_COLON, - STATE(48), 1, - sym_label_block, - ACTIONS(214), 2, + [1141] = 4, + ACTIONS(232), 1, + anon_sym_LBRACE, + STATE(70), 1, + sym_container, + ACTIONS(230), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(200), 9, + ACTIONS(194), 9, anon_sym_LPAREN, anon_sym_RBRACE, anon_sym_DASH, @@ -2521,15 +3002,15 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [728] = 4, - ACTIONS(41), 1, + [1163] = 4, + ACTIONS(266), 1, anon_sym_COLON, - STATE(54), 1, - sym_label_block, - ACTIONS(216), 2, + ACTIONS(268), 1, + sym_connection_identifier, + ACTIONS(236), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(210), 9, + ACTIONS(204), 9, anon_sym_LPAREN, anon_sym_RBRACE, anon_sym_DASH, @@ -2539,17 +3020,14 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [750] = 4, - ACTIONS(41), 1, - anon_sym_COLON, - STATE(52), 1, - sym_label_block, - ACTIONS(204), 2, + [1185] = 3, + ACTIONS(240), 1, + ts_builtin_sym_end, + ACTIONS(244), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(188), 9, + ACTIONS(242), 9, anon_sym_LPAREN, - anon_sym_RBRACE, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, @@ -2557,13 +3035,14 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [772] = 3, - ACTIONS(218), 1, + sym__comment, + [1204] = 3, + ACTIONS(210), 1, ts_builtin_sym_end, - ACTIONS(222), 2, + ACTIONS(214), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(220), 9, + ACTIONS(212), 9, anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, @@ -2573,49 +3052,35 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token4, sym__ident_regex, sym__comment, - [791] = 7, - ACTIONS(47), 1, + [1223] = 7, + ACTIONS(65), 1, anon_sym_DASH, - ACTIONS(49), 1, + ACTIONS(67), 1, anon_sym_DOT, - ACTIONS(158), 1, + ACTIONS(164), 1, sym__ident_regex, - ACTIONS(51), 2, + ACTIONS(69), 2, aux_sym_connection_token1, aux_sym_connection_token2, - ACTIONS(53), 2, + ACTIONS(71), 2, aux_sym_connection_token3, aux_sym_connection_token4, - STATE(18), 2, + STATE(13), 2, sym_sub_identifier, aux_sym_identifier_repeat1, - STATE(5), 3, + STATE(7), 3, sym_identifier, sym_connection, aux_sym_expression_repeat1, - [818] = 2, - ACTIONS(224), 1, - ts_builtin_sym_end, - ACTIONS(226), 11, - anon_sym_LPAREN, - aux_sym_expression_token1, - anon_sym_SEMI, - anon_sym_DASH, - anon_sym_DOT, - aux_sym_connection_token1, - aux_sym_connection_token2, - aux_sym_connection_token3, - aux_sym_connection_token4, - sym__ident_regex, - sym__comment, - [835] = 3, - ACTIONS(208), 1, - ts_builtin_sym_end, - ACTIONS(212), 2, + [1250] = 3, + ACTIONS(270), 1, + anon_sym_COLON, + ACTIONS(246), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(210), 9, + ACTIONS(220), 9, anon_sym_LPAREN, + anon_sym_RBRACE, anon_sym_DASH, anon_sym_DOT, aux_sym_connection_token1, @@ -2623,8 +3088,7 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - sym__comment, - [854] = 7, + [1269] = 7, ACTIONS(7), 1, anon_sym_DASH, ACTIONS(9), 1, @@ -2637,20 +3101,36 @@ static const uint16_t ts_small_parse_table[] = { ACTIONS(13), 2, aux_sym_connection_token3, aux_sym_connection_token4, - STATE(8), 2, + STATE(11), 2, sym_sub_identifier, aux_sym_identifier_repeat1, - STATE(3), 3, + STATE(4), 3, sym_identifier, sym_connection, aux_sym_expression_repeat1, - [881] = 3, - ACTIONS(31), 1, + [1296] = 3, + ACTIONS(272), 1, + anon_sym_COLON, + ACTIONS(250), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(212), 9, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [1315] = 3, + ACTIONS(202), 1, ts_builtin_sym_end, - ACTIONS(37), 2, + ACTIONS(206), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(33), 9, + ACTIONS(204), 9, anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, @@ -2660,13 +3140,29 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token4, sym__ident_regex, sym__comment, - [900] = 3, - ACTIONS(186), 1, + [1334] = 3, + ACTIONS(192), 1, + ts_builtin_sym_end, + ACTIONS(196), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(194), 9, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + sym__comment, + [1353] = 3, + ACTIONS(274), 1, ts_builtin_sym_end, - ACTIONS(190), 2, + ACTIONS(278), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(188), 9, + ACTIONS(276), 9, anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, @@ -2676,10 +3172,10 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token4, sym__ident_regex, sym__comment, - [919] = 2, - ACTIONS(228), 1, + [1372] = 2, + ACTIONS(280), 1, ts_builtin_sym_end, - ACTIONS(230), 11, + ACTIONS(282), 11, anon_sym_LPAREN, aux_sym_expression_token1, anon_sym_SEMI, @@ -2691,10 +3187,26 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token4, sym__ident_regex, sym__comment, - [936] = 2, - ACTIONS(232), 1, + [1389] = 3, + ACTIONS(266), 1, + anon_sym_COLON, + ACTIONS(236), 2, + aux_sym_expression_token1, + anon_sym_SEMI, + ACTIONS(204), 9, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__ident_regex, + [1408] = 2, + ACTIONS(284), 1, ts_builtin_sym_end, - ACTIONS(234), 11, + ACTIONS(286), 11, anon_sym_LPAREN, aux_sym_expression_token1, anon_sym_SEMI, @@ -2706,13 +3218,13 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token4, sym__ident_regex, sym__comment, - [953] = 3, - ACTIONS(198), 1, + [1425] = 3, + ACTIONS(218), 1, ts_builtin_sym_end, - ACTIONS(202), 2, + ACTIONS(222), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(200), 9, + ACTIONS(220), 9, anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, @@ -2722,11 +3234,11 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token4, sym__ident_regex, sym__comment, - [972] = 2, - ACTIONS(204), 2, + [1444] = 2, + ACTIONS(250), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(188), 9, + ACTIONS(212), 9, anon_sym_LPAREN, anon_sym_RBRACE, anon_sym_DASH, @@ -2736,11 +3248,11 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [988] = 2, - ACTIONS(216), 2, + [1460] = 2, + ACTIONS(246), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(210), 9, + ACTIONS(220), 9, anon_sym_LPAREN, anon_sym_RBRACE, anon_sym_DASH, @@ -2750,11 +3262,12 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [1004] = 1, - ACTIONS(226), 11, - anon_sym_LPAREN, + [1476] = 2, + ACTIONS(288), 2, aux_sym_expression_token1, anon_sym_SEMI, + ACTIONS(276), 9, + anon_sym_LPAREN, anon_sym_RBRACE, anon_sym_DASH, anon_sym_DOT, @@ -2763,11 +3276,12 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [1018] = 1, - ACTIONS(234), 11, - anon_sym_LPAREN, + [1492] = 2, + ACTIONS(260), 2, aux_sym_expression_token1, anon_sym_SEMI, + ACTIONS(242), 9, + anon_sym_LPAREN, anon_sym_RBRACE, anon_sym_DASH, anon_sym_DOT, @@ -2776,11 +3290,12 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [1032] = 1, - ACTIONS(230), 11, - anon_sym_LPAREN, + [1508] = 2, + ACTIONS(230), 2, aux_sym_expression_token1, anon_sym_SEMI, + ACTIONS(194), 9, + anon_sym_LPAREN, anon_sym_RBRACE, anon_sym_DASH, anon_sym_DOT, @@ -2789,11 +3304,11 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [1046] = 2, - ACTIONS(214), 2, + [1524] = 2, + ACTIONS(236), 2, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(200), 9, + ACTIONS(204), 9, anon_sym_LPAREN, anon_sym_RBRACE, anon_sym_DASH, @@ -2803,12 +3318,11 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [1062] = 2, - ACTIONS(59), 2, + [1540] = 1, + ACTIONS(286), 11, + anon_sym_LPAREN, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(33), 9, - anon_sym_LPAREN, anon_sym_RBRACE, anon_sym_DASH, anon_sym_DOT, @@ -2817,12 +3331,11 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [1078] = 2, - ACTIONS(236), 2, + [1554] = 1, + ACTIONS(282), 11, + anon_sym_LPAREN, aux_sym_expression_token1, anon_sym_SEMI, - ACTIONS(220), 9, - anon_sym_LPAREN, anon_sym_RBRACE, anon_sym_DASH, anon_sym_DOT, @@ -2831,11 +3344,11 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__ident_regex, - [1094] = 2, - ACTIONS(238), 2, + [1568] = 2, + ACTIONS(218), 2, ts_builtin_sym_end, sym__ident_regex, - ACTIONS(240), 8, + ACTIONS(220), 8, anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, @@ -2844,11 +3357,11 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__comment, - [1109] = 2, - ACTIONS(186), 2, + [1583] = 2, + ACTIONS(47), 2, ts_builtin_sym_end, sym__ident_regex, - ACTIONS(188), 8, + ACTIONS(51), 8, anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, @@ -2857,11 +3370,11 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__comment, - [1124] = 2, - ACTIONS(218), 2, + [1598] = 2, + ACTIONS(210), 2, ts_builtin_sym_end, sym__ident_regex, - ACTIONS(220), 8, + ACTIONS(212), 8, anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, @@ -2870,11 +3383,11 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__comment, - [1139] = 2, - ACTIONS(198), 2, + [1613] = 2, + ACTIONS(290), 2, ts_builtin_sym_end, sym__ident_regex, - ACTIONS(200), 8, + ACTIONS(292), 8, anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, @@ -2883,11 +3396,11 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__comment, - [1154] = 2, - ACTIONS(208), 2, + [1628] = 2, + ACTIONS(192), 2, ts_builtin_sym_end, sym__ident_regex, - ACTIONS(210), 8, + ACTIONS(194), 8, anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, @@ -2896,11 +3409,11 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__comment, - [1169] = 2, - ACTIONS(31), 2, + [1643] = 2, + ACTIONS(202), 2, ts_builtin_sym_end, sym__ident_regex, - ACTIONS(33), 8, + ACTIONS(204), 8, anon_sym_LPAREN, anon_sym_DASH, anon_sym_DOT, @@ -2909,10 +3422,36 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token3, aux_sym_connection_token4, sym__comment, - [1184] = 2, - ACTIONS(238), 1, + [1658] = 2, + ACTIONS(240), 2, + ts_builtin_sym_end, + sym__ident_regex, + ACTIONS(242), 8, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__comment, + [1673] = 2, + ACTIONS(274), 2, + ts_builtin_sym_end, + sym__ident_regex, + ACTIONS(276), 8, + anon_sym_LPAREN, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + sym__comment, + [1688] = 2, + ACTIONS(240), 1, sym__ident_regex, - ACTIONS(240), 8, + ACTIONS(242), 8, anon_sym_LPAREN, anon_sym_RBRACE, anon_sym_DASH, @@ -2921,10 +3460,10 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, - [1198] = 2, - ACTIONS(198), 1, + [1702] = 2, + ACTIONS(218), 1, sym__ident_regex, - ACTIONS(200), 8, + ACTIONS(220), 8, anon_sym_LPAREN, anon_sym_RBRACE, anon_sym_DASH, @@ -2933,10 +3472,10 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, - [1212] = 2, - ACTIONS(31), 1, + [1716] = 2, + ACTIONS(192), 1, sym__ident_regex, - ACTIONS(33), 8, + ACTIONS(194), 8, anon_sym_LPAREN, anon_sym_RBRACE, anon_sym_DASH, @@ -2945,10 +3484,10 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, - [1226] = 2, - ACTIONS(208), 1, + [1730] = 2, + ACTIONS(210), 1, sym__ident_regex, - ACTIONS(210), 8, + ACTIONS(212), 8, anon_sym_LPAREN, anon_sym_RBRACE, anon_sym_DASH, @@ -2957,10 +3496,10 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, - [1240] = 2, - ACTIONS(186), 1, + [1744] = 2, + ACTIONS(47), 1, sym__ident_regex, - ACTIONS(188), 8, + ACTIONS(51), 8, anon_sym_LPAREN, anon_sym_RBRACE, anon_sym_DASH, @@ -2969,10 +3508,10 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, - [1254] = 2, - ACTIONS(218), 1, + [1758] = 2, + ACTIONS(274), 1, sym__ident_regex, - ACTIONS(220), 8, + ACTIONS(276), 8, anon_sym_LPAREN, anon_sym_RBRACE, anon_sym_DASH, @@ -2981,285 +3520,339 @@ static const uint16_t ts_small_parse_table[] = { aux_sym_connection_token2, aux_sym_connection_token3, aux_sym_connection_token4, - [1268] = 5, - ACTIONS(7), 1, + [1772] = 2, + ACTIONS(202), 1, + sym__ident_regex, + ACTIONS(204), 8, + anon_sym_LPAREN, + anon_sym_RBRACE, anon_sym_DASH, - ACTIONS(9), 1, anon_sym_DOT, - ACTIONS(15), 1, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + [1786] = 2, + ACTIONS(290), 1, sym__ident_regex, - STATE(21), 1, + ACTIONS(292), 8, + anon_sym_LPAREN, + anon_sym_RBRACE, + anon_sym_DASH, + anon_sym_DOT, + aux_sym_connection_token1, + aux_sym_connection_token2, + aux_sym_connection_token3, + aux_sym_connection_token4, + [1800] = 5, + ACTIONS(65), 1, + anon_sym_DASH, + ACTIONS(67), 1, + anon_sym_DOT, + ACTIONS(164), 1, + sym__ident_regex, + STATE(30), 1, sym_identifier, - STATE(8), 2, + STATE(13), 2, sym_sub_identifier, aux_sym_identifier_repeat1, - [1285] = 5, - ACTIONS(47), 1, + [1817] = 5, + ACTIONS(7), 1, anon_sym_DASH, - ACTIONS(49), 1, + ACTIONS(9), 1, anon_sym_DOT, - ACTIONS(158), 1, + ACTIONS(15), 1, sym__ident_regex, - STATE(27), 1, + STATE(21), 1, sym_identifier, - STATE(18), 2, + STATE(11), 2, sym_sub_identifier, aux_sym_identifier_repeat1, - [1302] = 3, - ACTIONS(242), 1, - anon_sym_LBRACE, - ACTIONS(244), 1, - sym_label, + [1834] = 2, + ACTIONS(294), 1, + anon_sym_DOT, STATE(51), 1, - sym_container, - [1312] = 3, - ACTIONS(246), 1, - anon_sym_LBRACE, - ACTIONS(248), 1, - sym_label, - STATE(44), 1, - sym_container, - [1322] = 2, - ACTIONS(250), 1, + sym_sub_identifier, + [1841] = 2, + ACTIONS(296), 1, anon_sym_DOT, - STATE(34), 1, + STATE(64), 1, sym_sub_identifier, - [1329] = 2, - ACTIONS(252), 1, - aux_sym_connection_token1, - ACTIONS(254), 1, - aux_sym_connection_token3, - [1336] = 2, - ACTIONS(250), 1, + [1848] = 2, + ACTIONS(296), 1, anon_sym_DOT, - STATE(35), 1, + STATE(57), 1, sym_sub_identifier, - [1343] = 2, - ACTIONS(256), 1, + [1855] = 2, + ACTIONS(294), 1, anon_sym_DOT, - STATE(33), 1, + STATE(50), 1, sym_sub_identifier, - [1350] = 2, - ACTIONS(256), 1, + [1862] = 2, + ACTIONS(294), 1, anon_sym_DOT, - STATE(28), 1, + STATE(48), 1, sym_sub_identifier, - [1357] = 2, - ACTIONS(258), 1, + [1869] = 2, + ACTIONS(298), 1, aux_sym_connection_token1, - ACTIONS(260), 1, + ACTIONS(300), 1, aux_sym_connection_token3, - [1364] = 2, - ACTIONS(256), 1, - anon_sym_DOT, - STATE(31), 1, - sym_sub_identifier, - [1371] = 2, - ACTIONS(250), 1, + [1876] = 2, + ACTIONS(296), 1, anon_sym_DOT, - STATE(36), 1, + STATE(59), 1, sym_sub_identifier, - [1378] = 1, - ACTIONS(262), 1, + [1883] = 2, + ACTIONS(302), 1, + aux_sym_connection_token1, + ACTIONS(304), 1, + aux_sym_connection_token3, + [1890] = 1, + ACTIONS(306), 1, ts_builtin_sym_end, }; static const uint32_t ts_small_parse_table_map[] = { [SMALL_STATE(8)] = 0, - [SMALL_STATE(9)] = 28, + [SMALL_STATE(9)] = 40, [SMALL_STATE(10)] = 68, [SMALL_STATE(11)] = 108, [SMALL_STATE(12)] = 136, [SMALL_STATE(13)] = 173, - [SMALL_STATE(14)] = 210, - [SMALL_STATE(15)] = 247, - [SMALL_STATE(16)] = 272, - [SMALL_STATE(17)] = 309, + [SMALL_STATE(14)] = 198, + [SMALL_STATE(15)] = 235, + [SMALL_STATE(16)] = 258, + [SMALL_STATE(17)] = 295, [SMALL_STATE(18)] = 332, [SMALL_STATE(19)] = 357, [SMALL_STATE(20)] = 394, - [SMALL_STATE(21)] = 414, - [SMALL_STATE(22)] = 434, - [SMALL_STATE(23)] = 462, - [SMALL_STATE(24)] = 482, + [SMALL_STATE(21)] = 422, + [SMALL_STATE(22)] = 442, + [SMALL_STATE(23)] = 470, + [SMALL_STATE(24)] = 490, [SMALL_STATE(25)] = 510, - [SMALL_STATE(26)] = 530, - [SMALL_STATE(27)] = 547, - [SMALL_STATE(28)] = 564, - [SMALL_STATE(29)] = 589, - [SMALL_STATE(30)] = 614, - [SMALL_STATE(31)] = 631, - [SMALL_STATE(32)] = 656, - [SMALL_STATE(33)] = 681, - [SMALL_STATE(34)] = 706, - [SMALL_STATE(35)] = 728, - [SMALL_STATE(36)] = 750, - [SMALL_STATE(37)] = 772, - [SMALL_STATE(38)] = 791, - [SMALL_STATE(39)] = 818, - [SMALL_STATE(40)] = 835, - [SMALL_STATE(41)] = 854, - [SMALL_STATE(42)] = 881, - [SMALL_STATE(43)] = 900, - [SMALL_STATE(44)] = 919, - [SMALL_STATE(45)] = 936, - [SMALL_STATE(46)] = 953, - [SMALL_STATE(47)] = 972, - [SMALL_STATE(48)] = 988, - [SMALL_STATE(49)] = 1004, - [SMALL_STATE(50)] = 1018, - [SMALL_STATE(51)] = 1032, - [SMALL_STATE(52)] = 1046, - [SMALL_STATE(53)] = 1062, - [SMALL_STATE(54)] = 1078, - [SMALL_STATE(55)] = 1094, - [SMALL_STATE(56)] = 1109, - [SMALL_STATE(57)] = 1124, - [SMALL_STATE(58)] = 1139, - [SMALL_STATE(59)] = 1154, - [SMALL_STATE(60)] = 1169, - [SMALL_STATE(61)] = 1184, - [SMALL_STATE(62)] = 1198, - [SMALL_STATE(63)] = 1212, - [SMALL_STATE(64)] = 1226, - [SMALL_STATE(65)] = 1240, - [SMALL_STATE(66)] = 1254, - [SMALL_STATE(67)] = 1268, - [SMALL_STATE(68)] = 1285, - [SMALL_STATE(69)] = 1302, - [SMALL_STATE(70)] = 1312, - [SMALL_STATE(71)] = 1322, - [SMALL_STATE(72)] = 1329, - [SMALL_STATE(73)] = 1336, - [SMALL_STATE(74)] = 1343, - [SMALL_STATE(75)] = 1350, - [SMALL_STATE(76)] = 1357, - [SMALL_STATE(77)] = 1364, - [SMALL_STATE(78)] = 1371, - [SMALL_STATE(79)] = 1378, + [SMALL_STATE(26)] = 538, + [SMALL_STATE(27)] = 566, + [SMALL_STATE(28)] = 594, + [SMALL_STATE(29)] = 614, + [SMALL_STATE(30)] = 639, + [SMALL_STATE(31)] = 656, + [SMALL_STATE(32)] = 673, + [SMALL_STATE(33)] = 690, + [SMALL_STATE(34)] = 715, + [SMALL_STATE(35)] = 740, + [SMALL_STATE(36)] = 765, + [SMALL_STATE(37)] = 790, + [SMALL_STATE(38)] = 815, + [SMALL_STATE(39)] = 840, + [SMALL_STATE(40)] = 865, + [SMALL_STATE(41)] = 890, + [SMALL_STATE(42)] = 915, + [SMALL_STATE(43)] = 940, + [SMALL_STATE(44)] = 965, + [SMALL_STATE(45)] = 987, + [SMALL_STATE(46)] = 1009, + [SMALL_STATE(47)] = 1031, + [SMALL_STATE(48)] = 1053, + [SMALL_STATE(49)] = 1075, + [SMALL_STATE(50)] = 1097, + [SMALL_STATE(51)] = 1119, + [SMALL_STATE(52)] = 1141, + [SMALL_STATE(53)] = 1163, + [SMALL_STATE(54)] = 1185, + [SMALL_STATE(55)] = 1204, + [SMALL_STATE(56)] = 1223, + [SMALL_STATE(57)] = 1250, + [SMALL_STATE(58)] = 1269, + [SMALL_STATE(59)] = 1296, + [SMALL_STATE(60)] = 1315, + [SMALL_STATE(61)] = 1334, + [SMALL_STATE(62)] = 1353, + [SMALL_STATE(63)] = 1372, + [SMALL_STATE(64)] = 1389, + [SMALL_STATE(65)] = 1408, + [SMALL_STATE(66)] = 1425, + [SMALL_STATE(67)] = 1444, + [SMALL_STATE(68)] = 1460, + [SMALL_STATE(69)] = 1476, + [SMALL_STATE(70)] = 1492, + [SMALL_STATE(71)] = 1508, + [SMALL_STATE(72)] = 1524, + [SMALL_STATE(73)] = 1540, + [SMALL_STATE(74)] = 1554, + [SMALL_STATE(75)] = 1568, + [SMALL_STATE(76)] = 1583, + [SMALL_STATE(77)] = 1598, + [SMALL_STATE(78)] = 1613, + [SMALL_STATE(79)] = 1628, + [SMALL_STATE(80)] = 1643, + [SMALL_STATE(81)] = 1658, + [SMALL_STATE(82)] = 1673, + [SMALL_STATE(83)] = 1688, + [SMALL_STATE(84)] = 1702, + [SMALL_STATE(85)] = 1716, + [SMALL_STATE(86)] = 1730, + [SMALL_STATE(87)] = 1744, + [SMALL_STATE(88)] = 1758, + [SMALL_STATE(89)] = 1772, + [SMALL_STATE(90)] = 1786, + [SMALL_STATE(91)] = 1800, + [SMALL_STATE(92)] = 1817, + [SMALL_STATE(93)] = 1834, + [SMALL_STATE(94)] = 1841, + [SMALL_STATE(95)] = 1848, + [SMALL_STATE(96)] = 1855, + [SMALL_STATE(97)] = 1862, + [SMALL_STATE(98)] = 1869, + [SMALL_STATE(99)] = 1876, + [SMALL_STATE(100)] = 1883, + [SMALL_STATE(101)] = 1890, }; 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_source_file, 0), - [5] = {.entry = {.count = 1, .reusable = false}}, SHIFT(41), - [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), - [9] = {.entry = {.count = 1, .reusable = false}}, SHIFT(67), - [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(17), - [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(20), - [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), + [5] = {.entry = {.count = 1, .reusable = false}}, SHIFT(58), + [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11), + [9] = {.entry = {.count = 1, .reusable = false}}, SHIFT(92), + [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(15), + [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(24), + [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), [17] = {.entry = {.count = 1, .reusable = false}}, SHIFT(10), - [19] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 1), - [21] = {.entry = {.count = 1, .reusable = false}}, SHIFT(70), - [23] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 1), - [25] = {.entry = {.count = 1, .reusable = false}}, SHIFT(22), - [27] = {.entry = {.count = 1, .reusable = false}}, SHIFT(60), - [29] = {.entry = {.count = 1, .reusable = false}}, SHIFT(75), - [31] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 2), - [33] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 2), - [35] = {.entry = {.count = 1, .reusable = false}}, SHIFT(24), - [37] = {.entry = {.count = 1, .reusable = false}}, SHIFT(56), - [39] = {.entry = {.count = 1, .reusable = false}}, SHIFT(77), - [41] = {.entry = {.count = 1, .reusable = false}}, SHIFT(69), - [43] = {.entry = {.count = 1, .reusable = false}}, SHIFT(29), - [45] = {.entry = {.count = 1, .reusable = false}}, SHIFT(63), - [47] = {.entry = {.count = 1, .reusable = false}}, SHIFT(18), - [49] = {.entry = {.count = 1, .reusable = false}}, SHIFT(68), - [51] = {.entry = {.count = 1, .reusable = false}}, SHIFT(23), - [53] = {.entry = {.count = 1, .reusable = false}}, SHIFT(30), - [55] = {.entry = {.count = 1, .reusable = false}}, SHIFT(78), - [57] = {.entry = {.count = 1, .reusable = false}}, SHIFT(32), - [59] = {.entry = {.count = 1, .reusable = false}}, SHIFT(65), - [61] = {.entry = {.count = 1, .reusable = false}}, SHIFT(71), - [63] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_expression_repeat1, 2), - [65] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), - [67] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(8), - [70] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(67), - [73] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(17), - [76] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(20), - [79] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(18), - [82] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(68), - [85] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(23), - [88] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(30), - [91] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_identifier, 1), - [93] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_identifier, 1), - [95] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11), - [97] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), - [99] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(41), - [102] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(8), - [105] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(67), - [108] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(17), - [111] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(20), - [114] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(8), - [117] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(9), - [120] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), - [122] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9), - [124] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_identifier_repeat1, 2), - [126] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), - [128] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(11), - [131] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(67), - [134] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_container_repeat1, 2), SHIFT_REPEAT(38), - [137] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_container_repeat1, 2), - [139] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_container_repeat1, 2), SHIFT_REPEAT(18), - [142] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_container_repeat1, 2), SHIFT_REPEAT(68), - [145] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_container_repeat1, 2), SHIFT_REPEAT(23), - [148] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_container_repeat1, 2), SHIFT_REPEAT(30), - [151] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_container_repeat1, 2), SHIFT_REPEAT(18), - [154] = {.entry = {.count = 1, .reusable = false}}, SHIFT(38), - [156] = {.entry = {.count = 1, .reusable = false}}, SHIFT(50), - [158] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), - [160] = {.entry = {.count = 1, .reusable = false}}, SHIFT(39), - [162] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(15), - [165] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(68), - [168] = {.entry = {.count = 1, .reusable = false}}, SHIFT(49), - [170] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_connection, 1), - [172] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_connection, 1), - [174] = {.entry = {.count = 1, .reusable = false}}, SHIFT(72), - [176] = {.entry = {.count = 1, .reusable = false}}, SHIFT(15), - [178] = {.entry = {.count = 1, .reusable = false}}, SHIFT(45), - [180] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sub_identifier, 2), - [182] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sub_identifier, 2), - [184] = {.entry = {.count = 1, .reusable = false}}, SHIFT(76), - [186] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 3), - [188] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 3), - [190] = {.entry = {.count = 1, .reusable = false}}, SHIFT(58), - [192] = {.entry = {.count = 1, .reusable = false}}, SHIFT(74), - [194] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_connection, 3), - [196] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_connection, 3), - [198] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 4), - [200] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 4), - [202] = {.entry = {.count = 1, .reusable = false}}, SHIFT(59), - [204] = {.entry = {.count = 1, .reusable = false}}, SHIFT(62), - [206] = {.entry = {.count = 1, .reusable = false}}, SHIFT(73), - [208] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 5), - [210] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 5), - [212] = {.entry = {.count = 1, .reusable = false}}, SHIFT(57), - [214] = {.entry = {.count = 1, .reusable = false}}, SHIFT(64), - [216] = {.entry = {.count = 1, .reusable = false}}, SHIFT(66), - [218] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 6), - [220] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 6), - [222] = {.entry = {.count = 1, .reusable = false}}, SHIFT(55), - [224] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_container, 3), - [226] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_container, 3), - [228] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_label_block, 2), - [230] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_label_block, 2), - [232] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_container, 2), - [234] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_container, 2), - [236] = {.entry = {.count = 1, .reusable = false}}, SHIFT(61), - [238] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 7), - [240] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 7), - [242] = {.entry = {.count = 1, .reusable = false}}, SHIFT(13), - [244] = {.entry = {.count = 1, .reusable = false}}, SHIFT(51), - [246] = {.entry = {.count = 1, .reusable = false}}, SHIFT(19), - [248] = {.entry = {.count = 1, .reusable = false}}, SHIFT(44), - [250] = {.entry = {.count = 1, .reusable = true}}, SHIFT(68), - [252] = {.entry = {.count = 1, .reusable = false}}, SHIFT(25), - [254] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), - [256] = {.entry = {.count = 1, .reusable = true}}, SHIFT(67), - [258] = {.entry = {.count = 1, .reusable = false}}, SHIFT(26), - [260] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), - [262] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [19] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_expression_repeat1, 2), + [21] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), + [23] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(11), + [26] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(92), + [29] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(15), + [32] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(24), + [35] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 1), + [37] = {.entry = {.count = 1, .reusable = false}}, SHIFT(20), + [39] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 1), + [41] = {.entry = {.count = 1, .reusable = false}}, SHIFT(33), + [43] = {.entry = {.count = 1, .reusable = false}}, SHIFT(76), + [45] = {.entry = {.count = 1, .reusable = false}}, SHIFT(96), + [47] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 2), + [49] = {.entry = {.count = 1, .reusable = false}}, SHIFT(25), + [51] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 2), + [53] = {.entry = {.count = 1, .reusable = false}}, SHIFT(42), + [55] = {.entry = {.count = 1, .reusable = false}}, SHIFT(80), + [57] = {.entry = {.count = 1, .reusable = false}}, SHIFT(93), + [59] = {.entry = {.count = 1, .reusable = false}}, SHIFT(43), + [61] = {.entry = {.count = 1, .reusable = false}}, SHIFT(47), + [63] = {.entry = {.count = 1, .reusable = false}}, SHIFT(87), + [65] = {.entry = {.count = 1, .reusable = false}}, SHIFT(13), + [67] = {.entry = {.count = 1, .reusable = false}}, SHIFT(91), + [69] = {.entry = {.count = 1, .reusable = false}}, SHIFT(23), + [71] = {.entry = {.count = 1, .reusable = false}}, SHIFT(32), + [73] = {.entry = {.count = 1, .reusable = false}}, SHIFT(94), + [75] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(13), + [78] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(91), + [81] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(23), + [84] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_expression_repeat1, 2), SHIFT_REPEAT(32), + [87] = {.entry = {.count = 1, .reusable = false}}, SHIFT(35), + [89] = {.entry = {.count = 1, .reusable = false}}, SHIFT(53), + [91] = {.entry = {.count = 1, .reusable = false}}, SHIFT(89), + [93] = {.entry = {.count = 1, .reusable = false}}, SHIFT(99), + [95] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), + [97] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(58), + [100] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(11), + [103] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(92), + [106] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(15), + [109] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(24), + [112] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(11), + [115] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(8), + [118] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_identifier_repeat1, 2), + [120] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), + [122] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(9), + [125] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(92), + [128] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), + [130] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), + [132] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_identifier, 1), + [134] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_identifier, 1), + [136] = {.entry = {.count = 1, .reusable = false}}, SHIFT(9), + [138] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_container_repeat1, 2), SHIFT_REPEAT(56), + [141] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_container_repeat1, 2), + [143] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_container_repeat1, 2), SHIFT_REPEAT(13), + [146] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_container_repeat1, 2), SHIFT_REPEAT(91), + [149] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_container_repeat1, 2), SHIFT_REPEAT(23), + [152] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_container_repeat1, 2), SHIFT_REPEAT(32), + [155] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_container_repeat1, 2), SHIFT_REPEAT(13), + [158] = {.entry = {.count = 1, .reusable = false}}, SHIFT(18), + [160] = {.entry = {.count = 1, .reusable = false}}, SHIFT(56), + [162] = {.entry = {.count = 1, .reusable = false}}, SHIFT(73), + [164] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), + [166] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_connection, 1), + [168] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_connection, 1), + [170] = {.entry = {.count = 1, .reusable = false}}, SHIFT(98), + [172] = {.entry = {.count = 1, .reusable = false}}, SHIFT(63), + [174] = {.entry = {.count = 1, .reusable = false}}, SHIFT(74), + [176] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(18), + [179] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_identifier_repeat1, 2), SHIFT_REPEAT(91), + [182] = {.entry = {.count = 1, .reusable = false}}, SHIFT(65), + [184] = {.entry = {.count = 1, .reusable = false}}, SHIFT(16), + [186] = {.entry = {.count = 1, .reusable = false}}, SHIFT(29), + [188] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sub_identifier, 2), + [190] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sub_identifier, 2), + [192] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 6), + [194] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 6), + [196] = {.entry = {.count = 1, .reusable = false}}, SHIFT(81), + [198] = {.entry = {.count = 1, .reusable = false}}, SHIFT(37), + [200] = {.entry = {.count = 1, .reusable = false}}, SHIFT(100), + [202] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 3), + [204] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 3), + [206] = {.entry = {.count = 1, .reusable = false}}, SHIFT(77), + [208] = {.entry = {.count = 1, .reusable = false}}, SHIFT(36), + [210] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 4), + [212] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 4), + [214] = {.entry = {.count = 1, .reusable = false}}, SHIFT(75), + [216] = {.entry = {.count = 1, .reusable = false}}, SHIFT(39), + [218] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 5), + [220] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 5), + [222] = {.entry = {.count = 1, .reusable = false}}, SHIFT(79), + [224] = {.entry = {.count = 1, .reusable = false}}, SHIFT(40), + [226] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_connection, 3), + [228] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_connection, 3), + [230] = {.entry = {.count = 1, .reusable = false}}, SHIFT(83), + [232] = {.entry = {.count = 1, .reusable = false}}, SHIFT(17), + [234] = {.entry = {.count = 1, .reusable = false}}, SHIFT(44), + [236] = {.entry = {.count = 1, .reusable = false}}, SHIFT(86), + [238] = {.entry = {.count = 1, .reusable = false}}, SHIFT(49), + [240] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 7), + [242] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 7), + [244] = {.entry = {.count = 1, .reusable = false}}, SHIFT(82), + [246] = {.entry = {.count = 1, .reusable = false}}, SHIFT(85), + [248] = {.entry = {.count = 1, .reusable = false}}, SHIFT(52), + [250] = {.entry = {.count = 1, .reusable = false}}, SHIFT(84), + [252] = {.entry = {.count = 1, .reusable = false}}, SHIFT(45), + [254] = {.entry = {.count = 1, .reusable = false}}, SHIFT(26), + [256] = {.entry = {.count = 1, .reusable = false}}, SHIFT(97), + [258] = {.entry = {.count = 1, .reusable = false}}, SHIFT(46), + [260] = {.entry = {.count = 1, .reusable = false}}, SHIFT(88), + [262] = {.entry = {.count = 1, .reusable = false}}, SHIFT(22), + [264] = {.entry = {.count = 1, .reusable = false}}, SHIFT(27), + [266] = {.entry = {.count = 1, .reusable = false}}, SHIFT(41), + [268] = {.entry = {.count = 1, .reusable = false}}, SHIFT(95), + [270] = {.entry = {.count = 1, .reusable = false}}, SHIFT(34), + [272] = {.entry = {.count = 1, .reusable = false}}, SHIFT(38), + [274] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 8), + [276] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 8), + [278] = {.entry = {.count = 1, .reusable = false}}, SHIFT(78), + [280] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_container, 2), + [282] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_container, 2), + [284] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_container, 3), + [286] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_container, 3), + [288] = {.entry = {.count = 1, .reusable = false}}, SHIFT(90), + [290] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 9), + [292] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 9), + [294] = {.entry = {.count = 1, .reusable = true}}, SHIFT(92), + [296] = {.entry = {.count = 1, .reusable = true}}, SHIFT(91), + [298] = {.entry = {.count = 1, .reusable = false}}, SHIFT(28), + [300] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28), + [302] = {.entry = {.count = 1, .reusable = false}}, SHIFT(31), + [304] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), + [306] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), }; #ifdef __cplusplus diff --git a/test/corpus/connections.txt b/test/corpus/connections.txt index f09e6e5..34b9f89 100644 --- a/test/corpus/connections.txt +++ b/test/corpus/connections.txt @@ -1,140 +1,3 @@ -==================||| -Isolated valid connections -==================||| - --- --> -<- -<-> - ----||| - -(source_file - (expression - (connection)) - (expression - (connection)) - (expression - (connection)) - (expression - (connection))) - -==================||| -Isolated long connections -==================||| - ----------- ----------> -<--------- -<--------> - ----||| - -(source_file - (expression - (connection)) - (expression - (connection)) - (expression - (connection)) - (expression - (connection))) - -==================||| -Invalid connection "-" -==================||| - -- - ----||| - -(source_file - (expression - (identifier))) - -==================||| -Invalid connection ">" -==================||| - -> - ----||| - -(source_file - (ERROR - (UNEXPECTED '>'))) - -==================||| -Invalid connection "<" -==================||| - -< - ----||| - -(source_file - (ERROR - (UNEXPECTED '\n'))) - -==================||| -Invalid connection "<>" -==================||| - -<> - ----||| - -(source_file - (ERROR - (UNEXPECTED '>'))) - -==================||| -Basic -==================||| - -Write Replica Canada <-> Write Replica Australia - -Read Replica <- Master -Write Replica -> Master - -Read Replica 1 -- Read Replica 2 - ----||| - -(source_file - (expression - (identifier) - (connection) - (identifier)) - (expression - (identifier) - (connection) - (identifier)) - (expression - (identifier) - (connection) - (identifier)) - (expression - (identifier) - (connection) - (identifier))) - -==================||| -Connection labels -==================||| - -Read Replica 1 -- Read Replica 2: Kept in sync - ----||| - -(source_file - (expression - (identifier) - (connection) - (identifier) - (label_block - (label)))) - ==================||| Multiline shape ==================||| @@ -183,8 +46,7 @@ Database -> S3: backup (identifier) (connection) (identifier) - (label_block - (label))) + (label)) (expression (identifier) (connection) @@ -193,8 +55,7 @@ Database -> S3: backup (identifier) (connection) (identifier) - (label_block - (label)))) + (label))) ==================||| Connections Chaining @@ -212,8 +73,7 @@ High Mem Instance -> EC2 <- High CPU Instance: Hosted By (identifier) (connection) (identifier) - (label_block - (label)))) + (label))) ==================||| Cycles @@ -237,8 +97,7 @@ Stage Four -> Stage One: repeat (identifier) (connection) (identifier) - (label_block - (label)))) + (label))) ==================||| Connection identifiers @@ -257,14 +116,12 @@ x -> y: hello (identifier) (connection) (identifier) - (label_block - (label))) + (label)) (expression (identifier) (connection) (identifier) - (label_block - (label))) + (label)) (expression (identifier) (connection) @@ -274,8 +131,7 @@ x -> y: hello (identifier (sub_identifier (identifier)))) - (label_block - (label))) + (label)) (expression (identifier) (connection) @@ -285,5 +141,4 @@ x -> y: hello (identifier (sub_identifier (identifier)))) - (label_block - (label)))) + (label))) diff --git a/test/corpus/connections_basic.txt b/test/corpus/connections_basic.txt new file mode 100644 index 0000000..5da8157 --- /dev/null +++ b/test/corpus/connections_basic.txt @@ -0,0 +1,133 @@ +==================||| +Isolated valid connections +==================||| + +-- +-> +<- +<-> + +---||| + +(source_file + (expression + (connection)) + (expression + (connection)) + (expression + (connection)) + (expression + (connection))) + +==================||| +Isolated long connections +==================||| + +---------- +---------> +<--------- +<--------> + +---||| + +(source_file + (expression + (connection)) + (expression + (connection)) + (expression + (connection)) + (expression + (connection))) + +==================||| +Invalid connection "-" +==================||| + +- + +---||| + +(source_file + (expression + (identifier))) + +==================||| +Invalid connection ">" +==================||| + +> + +---||| + +(source_file + (ERROR + (UNEXPECTED '>'))) + +==================||| +Invalid connection "<" +==================||| + +< + +---||| + +(source_file + (ERROR + (UNEXPECTED '\n'))) + +==================||| +Invalid connection "<>" +==================||| + +<> + +---||| + +(source_file + (ERROR + (UNEXPECTED '>'))) + +==================||| +Simple 1-1 connections +==================||| + +Write Replica Canada <-> Write Replica Australia +Read Replica <- Master +Write Replica -> Master +Read Replica 1 -- Read Replica 2 + +---||| + +(source_file + (expression + (identifier) + (connection) + (identifier)) + (expression + (identifier) + (connection) + (identifier)) + (expression + (identifier) + (connection) + (identifier)) + (expression + (identifier) + (connection) + (identifier))) + +==================||| +Connection labels +==================||| + +Read Replica 1 -- Read Replica 2: Kept in sync + +---||| + +(source_file + (expression + (identifier) + (connection) + (identifier) + (label))) diff --git a/test/corpus/containers.txt b/test/corpus/containers.txt index 30df88e..aa6bd20 100644 --- a/test/corpus/containers.txt +++ b/test/corpus/containers.txt @@ -11,8 +11,7 @@ Cloud.shape: cloud (identifier (sub_identifier (identifier))) - (label_block - (label)))) + (label))) ================== Container With Spaces @@ -50,8 +49,7 @@ apartment.Bedroom.Bathroom -> office.Spare Room.Bathroom: Portal (identifier (sub_identifier (identifier))))) - (label_block - (label)))) + (label))) ================== Nested Syntax @@ -74,29 +72,26 @@ clouds: { (source_file (expression (identifier) - (label_block - (container - (expression - (identifier) - (label_block - (container - (expression - (identifier) - (connection) - (identifier)) - (expression - (identifier) - (connection) - (identifier))))) - (expression - (identifier) - (label_block - (container - (expression - (identifier) - (connection) - (identifier))))) - (expression - (identifier) - (connection) - (identifier)))))) + (container + (expression + (identifier) + (container + (expression + (identifier) + (connection) + (identifier)) + (expression + (identifier) + (connection) + (identifier)))) + (expression + (identifier) + (container + (expression + (identifier) + (connection) + (identifier)))) + (expression + (identifier) + (connection) + (identifier))))) diff --git a/test/corpus/labels.txt b/test/corpus/labels.txt index 57a5491..48e5e7f 100644 --- a/test/corpus/labels.txt +++ b/test/corpus/labels.txt @@ -10,9 +10,37 @@ Cloud: my cloud (source_file (expression (identifier) - (label_block - (label))) + (label)) (expression (identifier) - (label_block - (label)))) + (label))) + +================== +Shorthand container labels +================== + +#gcloud: Google Cloud { +# # any content +#} + +--- + +(source_file) + +================== +Reserved keyword "label" +================== + +gcloud: { + label: Google Cloud +} + +--- + +(source_file + (expression + (identifier) + (container + (expression + (identifier) + (label)))))