diff --git a/grammar.js b/grammar.js index 8ca1a61..e7cb8dc 100644 --- a/grammar.js +++ b/grammar.js @@ -38,6 +38,7 @@ module.exports = grammar({ $._string_literal, // Composites $.list_expression, + $.map_expression, ), // The Blueprint scanner makes use of Go's lexer, so copy their rule @@ -84,6 +85,22 @@ module.exports = grammar({ "]", ), + map_expression: ($) => seq( + "{", + optional(commaSeparated($._colon_property)), + "}", + ), + + // }}} + + // Properties {{{ + + _colon_property: ($) => seq( + field("field", $.identifier), + ":", + field("value", $._expr), + ), + // }}} } }); diff --git a/src/grammar.json b/src/grammar.json index 1d143a0..557367f 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -86,6 +86,10 @@ { "type": "SYMBOL", "name": "list_expression" + }, + { + "type": "SYMBOL", + "name": "map_expression" } ] }, @@ -273,6 +277,89 @@ "value": "]" } ] + }, + "map_expression": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "{" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "_colon_property" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "SYMBOL", + "name": "_colon_property" + } + ] + } + }, + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "BLANK" + } + ] + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "_colon_property": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "field", + "content": { + "type": "SYMBOL", + "name": "identifier" + } + }, + { + "type": "STRING", + "value": ":" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "_expr" + } + } + ] } }, "extras": [ diff --git a/src/node-types.json b/src/node-types.json index 6ce1da6..eeaa5cf 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -47,6 +47,10 @@ "type": "list_expression", "named": true }, + { + "type": "map_expression", + "named": true + }, { "type": "raw_string_literal", "named": true @@ -104,6 +108,10 @@ "type": "list_expression", "named": true }, + { + "type": "map_expression", + "named": true + }, { "type": "raw_string_literal", "named": true @@ -111,6 +119,52 @@ ] } }, + { + "type": "map_expression", + "named": true, + "fields": { + "field": { + "multiple": true, + "required": false, + "types": [ + { + "type": "identifier", + "named": true + } + ] + }, + "value": { + "multiple": true, + "required": false, + "types": [ + { + "type": "identifier", + "named": true + }, + { + "type": "integer_literal", + "named": true + }, + { + "type": "interpreted_string_literal", + "named": true + }, + { + "type": "list_expression", + "named": true + }, + { + "type": "map_expression", + "named": true + }, + { + "type": "raw_string_literal", + "named": true + } + ] + } + } + }, { "type": "source_file", "named": true, @@ -146,6 +200,10 @@ "type": "-", "named": false }, + { + "type": ":", + "named": false + }, { "type": "=", "named": false @@ -169,5 +227,13 @@ { "type": "raw_string_literal", "named": true + }, + { + "type": "{", + "named": false + }, + { + "type": "}", + "named": false } ] \ No newline at end of file diff --git a/src/parser.c b/src/parser.c index 2b757c6..f74b10a 100644 --- a/src/parser.c +++ b/src/parser.c @@ -6,15 +6,15 @@ #endif #define LANGUAGE_VERSION 14 -#define STATE_COUNT 35 +#define STATE_COUNT 51 #define LARGE_STATE_COUNT 2 -#define SYMBOL_COUNT 28 +#define SYMBOL_COUNT 34 #define ALIAS_COUNT 0 -#define TOKEN_COUNT 16 +#define TOKEN_COUNT 19 #define EXTERNAL_TOKEN_COUNT 0 -#define FIELD_COUNT 3 +#define FIELD_COUNT 5 #define MAX_ALIAS_SEQUENCE_LENGTH 5 -#define PRODUCTION_ID_COUNT 2 +#define PRODUCTION_ID_COUNT 6 enum ts_symbol_identifiers { anon_sym_POUND = 1, @@ -32,18 +32,24 @@ enum ts_symbol_identifiers { anon_sym_LBRACK = 13, anon_sym_COMMA = 14, anon_sym_RBRACK = 15, - sym_source_file = 16, - sym__definition = 17, - sym_comment = 18, - sym_assignment = 19, - sym__expr = 20, - sym_integer_literal = 21, - sym__string_literal = 22, - sym_interpreted_string_literal = 23, - sym_list_expression = 24, - aux_sym_source_file_repeat1 = 25, - aux_sym_interpreted_string_literal_repeat1 = 26, - aux_sym_list_expression_repeat1 = 27, + anon_sym_LBRACE = 16, + anon_sym_RBRACE = 17, + anon_sym_COLON = 18, + sym_source_file = 19, + sym__definition = 20, + sym_comment = 21, + sym_assignment = 22, + sym__expr = 23, + sym_integer_literal = 24, + sym__string_literal = 25, + sym_interpreted_string_literal = 26, + sym_list_expression = 27, + sym_map_expression = 28, + sym__colon_property = 29, + aux_sym_source_file_repeat1 = 30, + aux_sym_interpreted_string_literal_repeat1 = 31, + aux_sym_list_expression_repeat1 = 32, + aux_sym_map_expression_repeat1 = 33, }; static const char * const ts_symbol_names[] = { @@ -63,6 +69,9 @@ static const char * const ts_symbol_names[] = { [anon_sym_LBRACK] = "[", [anon_sym_COMMA] = ",", [anon_sym_RBRACK] = "]", + [anon_sym_LBRACE] = "{", + [anon_sym_RBRACE] = "}", + [anon_sym_COLON] = ":", [sym_source_file] = "source_file", [sym__definition] = "_definition", [sym_comment] = "comment", @@ -72,9 +81,12 @@ static const char * const ts_symbol_names[] = { [sym__string_literal] = "_string_literal", [sym_interpreted_string_literal] = "interpreted_string_literal", [sym_list_expression] = "list_expression", + [sym_map_expression] = "map_expression", + [sym__colon_property] = "_colon_property", [aux_sym_source_file_repeat1] = "source_file_repeat1", [aux_sym_interpreted_string_literal_repeat1] = "interpreted_string_literal_repeat1", [aux_sym_list_expression_repeat1] = "list_expression_repeat1", + [aux_sym_map_expression_repeat1] = "map_expression_repeat1", }; static const TSSymbol ts_symbol_map[] = { @@ -94,6 +106,9 @@ static const TSSymbol ts_symbol_map[] = { [anon_sym_LBRACK] = anon_sym_LBRACK, [anon_sym_COMMA] = anon_sym_COMMA, [anon_sym_RBRACK] = anon_sym_RBRACK, + [anon_sym_LBRACE] = anon_sym_LBRACE, + [anon_sym_RBRACE] = anon_sym_RBRACE, + [anon_sym_COLON] = anon_sym_COLON, [sym_source_file] = sym_source_file, [sym__definition] = sym__definition, [sym_comment] = sym_comment, @@ -103,9 +118,12 @@ static const TSSymbol ts_symbol_map[] = { [sym__string_literal] = sym__string_literal, [sym_interpreted_string_literal] = sym_interpreted_string_literal, [sym_list_expression] = sym_list_expression, + [sym_map_expression] = sym_map_expression, + [sym__colon_property] = sym__colon_property, [aux_sym_source_file_repeat1] = aux_sym_source_file_repeat1, [aux_sym_interpreted_string_literal_repeat1] = aux_sym_interpreted_string_literal_repeat1, [aux_sym_list_expression_repeat1] = aux_sym_list_expression_repeat1, + [aux_sym_map_expression_repeat1] = aux_sym_map_expression_repeat1, }; static const TSSymbolMetadata ts_symbol_metadata[] = { @@ -173,6 +191,18 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = false, }, + [anon_sym_LBRACE] = { + .visible = true, + .named = false, + }, + [anon_sym_RBRACE] = { + .visible = true, + .named = false, + }, + [anon_sym_COLON] = { + .visible = true, + .named = false, + }, [sym_source_file] = { .visible = true, .named = true, @@ -209,6 +239,14 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = true, }, + [sym_map_expression] = { + .visible = true, + .named = true, + }, + [sym__colon_property] = { + .visible = false, + .named = true, + }, [aux_sym_source_file_repeat1] = { .visible = false, .named = false, @@ -221,23 +259,35 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = false, .named = false, }, + [aux_sym_map_expression_repeat1] = { + .visible = false, + .named = false, + }, }; enum ts_field_identifiers { - field_left = 1, - field_operator = 2, - field_right = 3, + field_field = 1, + field_left = 2, + field_operator = 3, + field_right = 4, + field_value = 5, }; static const char * const ts_field_names[] = { [0] = NULL, + [field_field] = "field", [field_left] = "left", [field_operator] = "operator", [field_right] = "right", + [field_value] = "value", }; static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { [1] = {.index = 0, .length = 3}, + [2] = {.index = 3, .length = 2}, + [3] = {.index = 5, .length = 2}, + [4] = {.index = 7, .length = 4}, + [5] = {.index = 11, .length = 4}, }; static const TSFieldMapEntry ts_field_map_entries[] = { @@ -245,6 +295,22 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_left, 0}, {field_operator, 1}, {field_right, 2}, + [3] = + {field_field, 1, .inherited = true}, + {field_value, 1, .inherited = true}, + [5] = + {field_field, 0}, + {field_value, 2}, + [7] = + {field_field, 1, .inherited = true}, + {field_field, 2, .inherited = true}, + {field_value, 1, .inherited = true}, + {field_value, 2, .inherited = true}, + [11] = + {field_field, 0, .inherited = true}, + {field_field, 1, .inherited = true}, + {field_value, 0, .inherited = true}, + {field_value, 1, .inherited = true}, }; static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = { @@ -291,6 +357,22 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [32] = 32, [33] = 33, [34] = 34, + [35] = 35, + [36] = 36, + [37] = 37, + [38] = 38, + [39] = 39, + [40] = 40, + [41] = 41, + [42] = 42, + [43] = 43, + [44] = 44, + [45] = 45, + [46] = 46, + [47] = 47, + [48] = 48, + [49] = 49, + [50] = 50, }; static inline bool sym_identifier_character_set_1(int32_t c) { @@ -2124,11 +2206,14 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == '+') ADVANCE(4); if (lookahead == ',') ADVANCE(37); if (lookahead == '-') ADVANCE(26); + if (lookahead == ':') ADVANCE(41); if (lookahead == '=') ADVANCE(23); if (lookahead == '[') ADVANCE(36); if (lookahead == '\\') ADVANCE(5); if (lookahead == ']') ADVANCE(38); if (lookahead == '`') ADVANCE(15); + if (lookahead == '{') ADVANCE(39); + if (lookahead == '}') ADVANCE(40); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(16) if (('0' <= lookahead && lookahead <= '9')) ADVANCE(27); @@ -2159,6 +2244,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == '[') ADVANCE(36); if (lookahead == ']') ADVANCE(38); if (lookahead == '`') ADVANCE(15); + if (lookahead == '{') ADVANCE(39); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(3) if (('0' <= lookahead && lookahead <= '9')) ADVANCE(27); @@ -2229,10 +2315,13 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == '+') ADVANCE(4); if (lookahead == ',') ADVANCE(37); if (lookahead == '-') ADVANCE(26); + if (lookahead == ':') ADVANCE(41); if (lookahead == '=') ADVANCE(23); if (lookahead == '[') ADVANCE(36); if (lookahead == ']') ADVANCE(38); if (lookahead == '`') ADVANCE(15); + if (lookahead == '{') ADVANCE(39); + if (lookahead == '}') ADVANCE(40); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(16) if (('0' <= lookahead && lookahead <= '9')) ADVANCE(27); @@ -2334,6 +2423,15 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { case 38: ACCEPT_TOKEN(anon_sym_RBRACK); END_STATE(); + case 39: + ACCEPT_TOKEN(anon_sym_LBRACE); + END_STATE(); + case 40: + ACCEPT_TOKEN(anon_sym_RBRACE); + END_STATE(); + case 41: + ACCEPT_TOKEN(anon_sym_COLON); + END_STATE(); default: return false; } @@ -2347,7 +2445,7 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [4] = {.lex_state = 3}, [5] = {.lex_state = 3}, [6] = {.lex_state = 3}, - [7] = {.lex_state = 0}, + [7] = {.lex_state = 3}, [8] = {.lex_state = 0}, [9] = {.lex_state = 0}, [10] = {.lex_state = 0}, @@ -2356,25 +2454,41 @@ static const TSLexMode ts_lex_modes[STATE_COUNT] = { [13] = {.lex_state = 0}, [14] = {.lex_state = 0}, [15] = {.lex_state = 0}, - [16] = {.lex_state = 1}, + [16] = {.lex_state = 0}, [17] = {.lex_state = 0}, [18] = {.lex_state = 0}, - [19] = {.lex_state = 1}, + [19] = {.lex_state = 0}, [20] = {.lex_state = 0}, - [21] = {.lex_state = 1}, + [21] = {.lex_state = 0}, [22] = {.lex_state = 0}, - [23] = {.lex_state = 1}, + [23] = {.lex_state = 0}, [24] = {.lex_state = 0}, - [25] = {.lex_state = 0}, - [26] = {.lex_state = 0}, - [27] = {.lex_state = 0}, + [25] = {.lex_state = 1}, + [26] = {.lex_state = 1}, + [27] = {.lex_state = 1}, [28] = {.lex_state = 0}, [29] = {.lex_state = 0}, [30] = {.lex_state = 0}, - [31] = {.lex_state = 21}, + [31] = {.lex_state = 0}, [32] = {.lex_state = 0}, [33] = {.lex_state = 0}, - [34] = {(TSStateId)(-1)}, + [34] = {.lex_state = 0}, + [35] = {.lex_state = 0}, + [36] = {.lex_state = 1}, + [37] = {.lex_state = 0}, + [38] = {.lex_state = 0}, + [39] = {.lex_state = 0}, + [40] = {.lex_state = 0}, + [41] = {.lex_state = 0}, + [42] = {.lex_state = 0}, + [43] = {.lex_state = 0}, + [44] = {.lex_state = 0}, + [45] = {.lex_state = 0}, + [46] = {.lex_state = 0}, + [47] = {.lex_state = 21}, + [48] = {.lex_state = 0}, + [49] = {.lex_state = 0}, + [50] = {(TSStateId)(-1)}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { @@ -2394,13 +2508,16 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_LBRACK] = ACTIONS(1), [anon_sym_COMMA] = ACTIONS(1), [anon_sym_RBRACK] = ACTIONS(1), + [anon_sym_LBRACE] = ACTIONS(1), + [anon_sym_RBRACE] = ACTIONS(1), + [anon_sym_COLON] = ACTIONS(1), }, [1] = { - [sym_source_file] = STATE(33), - [sym__definition] = STATE(27), + [sym_source_file] = STATE(46), + [sym__definition] = STATE(38), [sym_comment] = STATE(1), - [sym_assignment] = STATE(26), - [aux_sym_source_file_repeat1] = STATE(8), + [sym_assignment] = STATE(43), + [aux_sym_source_file_repeat1] = STATE(24), [ts_builtin_sym_end] = ACTIONS(5), [anon_sym_POUND] = ACTIONS(3), [sym_identifier] = ACTIONS(7), @@ -2408,7 +2525,7 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { }; static const uint16_t ts_small_parse_table[] = { - [0] = 12, + [0] = 13, ACTIONS(3), 1, anon_sym_POUND, ACTIONS(9), 1, @@ -2425,17 +2542,20 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_LBRACK, ACTIONS(21), 1, anon_sym_RBRACK, + ACTIONS(23), 1, + anon_sym_LBRACE, STATE(2), 1, sym_comment, STATE(15), 1, sym_interpreted_string_literal, - STATE(29), 1, + STATE(33), 1, sym__expr, - STATE(12), 3, + STATE(12), 4, sym_integer_literal, sym__string_literal, sym_list_expression, - [39] = 12, + sym_map_expression, + [43] = 13, ACTIONS(3), 1, anon_sym_POUND, ACTIONS(9), 1, @@ -2451,18 +2571,21 @@ static const uint16_t ts_small_parse_table[] = { ACTIONS(19), 1, anon_sym_LBRACK, ACTIONS(23), 1, + anon_sym_LBRACE, + ACTIONS(25), 1, anon_sym_RBRACK, STATE(3), 1, sym_comment, STATE(15), 1, sym_interpreted_string_literal, - STATE(29), 1, + STATE(39), 1, sym__expr, - STATE(12), 3, + STATE(12), 4, sym_integer_literal, sym__string_literal, sym_list_expression, - [78] = 12, + sym_map_expression, + [86] = 13, ACTIONS(3), 1, anon_sym_POUND, ACTIONS(9), 1, @@ -2477,19 +2600,22 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_DQUOTE, ACTIONS(19), 1, anon_sym_LBRACK, - ACTIONS(25), 1, + ACTIONS(23), 1, + anon_sym_LBRACE, + ACTIONS(27), 1, anon_sym_RBRACK, STATE(4), 1, sym_comment, STATE(15), 1, sym_interpreted_string_literal, - STATE(22), 1, + STATE(39), 1, sym__expr, - STATE(12), 3, + STATE(12), 4, sym_integer_literal, sym__string_literal, sym_list_expression, - [117] = 11, + sym_map_expression, + [129] = 12, ACTIONS(3), 1, anon_sym_POUND, ACTIONS(9), 1, @@ -2504,17 +2630,20 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_DQUOTE, ACTIONS(19), 1, anon_sym_LBRACK, + ACTIONS(23), 1, + anon_sym_LBRACE, STATE(5), 1, sym_comment, STATE(15), 1, sym_interpreted_string_literal, - STATE(28), 1, + STATE(39), 1, sym__expr, - STATE(12), 3, + STATE(12), 4, sym_integer_literal, sym__string_literal, sym_list_expression, - [153] = 11, + sym_map_expression, + [169] = 12, ACTIONS(3), 1, anon_sym_POUND, ACTIONS(9), 1, @@ -2529,378 +2658,606 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_DQUOTE, ACTIONS(19), 1, anon_sym_LBRACK, + ACTIONS(23), 1, + anon_sym_LBRACE, STATE(6), 1, sym_comment, STATE(15), 1, sym_interpreted_string_literal, - STATE(29), 1, + STATE(40), 1, sym__expr, - STATE(12), 3, + STATE(12), 4, sym_integer_literal, sym__string_literal, sym_list_expression, - [189] = 6, + sym_map_expression, + [209] = 12, ACTIONS(3), 1, anon_sym_POUND, - ACTIONS(27), 1, - ts_builtin_sym_end, - ACTIONS(29), 1, + ACTIONS(9), 1, sym_identifier, - STATE(26), 1, - sym_assignment, - STATE(27), 1, - sym__definition, - STATE(7), 2, - sym_comment, - aux_sym_source_file_repeat1, - [209] = 7, - ACTIONS(3), 1, - anon_sym_POUND, - ACTIONS(7), 1, - sym_identifier, - ACTIONS(32), 1, - ts_builtin_sym_end, + ACTIONS(11), 1, + anon_sym_DASH, + ACTIONS(13), 1, + aux_sym_integer_literal_token1, + ACTIONS(15), 1, + sym_raw_string_literal, + ACTIONS(17), 1, + anon_sym_DQUOTE, + ACTIONS(19), 1, + anon_sym_LBRACK, + ACTIONS(23), 1, + anon_sym_LBRACE, STATE(7), 1, - aux_sym_source_file_repeat1, + sym_comment, + STATE(15), 1, + sym_interpreted_string_literal, + STATE(41), 1, + sym__expr, + STATE(12), 4, + sym_integer_literal, + sym__string_literal, + sym_list_expression, + sym_map_expression, + [249] = 3, + ACTIONS(3), 1, + anon_sym_POUND, STATE(8), 1, sym_comment, - STATE(26), 1, - sym_assignment, - STATE(27), 1, - sym__definition, - [231] = 3, + ACTIONS(29), 5, + ts_builtin_sym_end, + sym_identifier, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_RBRACE, + [263] = 3, ACTIONS(3), 1, anon_sym_POUND, STATE(9), 1, sym_comment, - ACTIONS(34), 4, + ACTIONS(31), 5, ts_builtin_sym_end, sym_identifier, anon_sym_COMMA, anon_sym_RBRACK, - [244] = 3, + anon_sym_RBRACE, + [277] = 3, ACTIONS(3), 1, anon_sym_POUND, STATE(10), 1, sym_comment, - ACTIONS(36), 4, + ACTIONS(33), 5, ts_builtin_sym_end, sym_identifier, anon_sym_COMMA, anon_sym_RBRACK, - [257] = 3, + anon_sym_RBRACE, + [291] = 6, ACTIONS(3), 1, anon_sym_POUND, - STATE(11), 1, - sym_comment, - ACTIONS(38), 4, + ACTIONS(35), 1, ts_builtin_sym_end, + ACTIONS(37), 1, sym_identifier, - anon_sym_COMMA, - anon_sym_RBRACK, - [270] = 3, + STATE(38), 1, + sym__definition, + STATE(43), 1, + sym_assignment, + STATE(11), 2, + sym_comment, + aux_sym_source_file_repeat1, + [311] = 3, ACTIONS(3), 1, anon_sym_POUND, STATE(12), 1, sym_comment, - ACTIONS(40), 4, + ACTIONS(40), 5, ts_builtin_sym_end, sym_identifier, anon_sym_COMMA, anon_sym_RBRACK, - [283] = 3, + anon_sym_RBRACE, + [325] = 3, ACTIONS(3), 1, anon_sym_POUND, STATE(13), 1, sym_comment, - ACTIONS(42), 4, + ACTIONS(42), 5, ts_builtin_sym_end, sym_identifier, anon_sym_COMMA, anon_sym_RBRACK, - [296] = 3, + anon_sym_RBRACE, + [339] = 3, ACTIONS(3), 1, anon_sym_POUND, STATE(14), 1, sym_comment, - ACTIONS(44), 4, + ACTIONS(44), 5, ts_builtin_sym_end, sym_identifier, anon_sym_COMMA, anon_sym_RBRACK, - [309] = 3, + anon_sym_RBRACE, + [353] = 3, ACTIONS(3), 1, anon_sym_POUND, STATE(15), 1, sym_comment, - ACTIONS(46), 4, + ACTIONS(46), 5, ts_builtin_sym_end, sym_identifier, anon_sym_COMMA, anon_sym_RBRACK, - [322] = 6, - ACTIONS(48), 1, + anon_sym_RBRACE, + [367] = 3, + ACTIONS(3), 1, anon_sym_POUND, - ACTIONS(50), 1, - aux_sym_interpreted_string_literal_token1, - ACTIONS(52), 1, - anon_sym_DQUOTE2, - ACTIONS(54), 1, - sym_escape_sequence, STATE(16), 1, sym_comment, - STATE(21), 1, - aux_sym_interpreted_string_literal_repeat1, - [341] = 3, + ACTIONS(48), 5, + ts_builtin_sym_end, + sym_identifier, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_RBRACE, + [381] = 3, ACTIONS(3), 1, anon_sym_POUND, STATE(17), 1, sym_comment, - ACTIONS(56), 4, + ACTIONS(50), 5, ts_builtin_sym_end, sym_identifier, anon_sym_COMMA, anon_sym_RBRACK, - [354] = 3, + anon_sym_RBRACE, + [395] = 3, ACTIONS(3), 1, anon_sym_POUND, STATE(18), 1, sym_comment, - ACTIONS(58), 4, + ACTIONS(52), 5, ts_builtin_sym_end, sym_identifier, anon_sym_COMMA, anon_sym_RBRACK, - [367] = 5, - ACTIONS(48), 1, + anon_sym_RBRACE, + [409] = 3, + ACTIONS(3), 1, anon_sym_POUND, - ACTIONS(60), 1, - aux_sym_interpreted_string_literal_token1, - ACTIONS(63), 1, - anon_sym_DQUOTE2, - ACTIONS(65), 1, - sym_escape_sequence, - STATE(19), 2, + STATE(19), 1, sym_comment, - aux_sym_interpreted_string_literal_repeat1, - [384] = 3, + ACTIONS(54), 5, + ts_builtin_sym_end, + sym_identifier, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_RBRACE, + [423] = 3, ACTIONS(3), 1, anon_sym_POUND, STATE(20), 1, sym_comment, - ACTIONS(68), 4, + ACTIONS(56), 5, ts_builtin_sym_end, sym_identifier, anon_sym_COMMA, anon_sym_RBRACK, - [397] = 6, - ACTIONS(48), 1, - anon_sym_POUND, - ACTIONS(50), 1, - aux_sym_interpreted_string_literal_token1, - ACTIONS(54), 1, - sym_escape_sequence, - ACTIONS(70), 1, - anon_sym_DQUOTE2, - STATE(19), 1, - aux_sym_interpreted_string_literal_repeat1, - STATE(21), 1, - sym_comment, - [416] = 5, + anon_sym_RBRACE, + [437] = 3, ACTIONS(3), 1, anon_sym_POUND, - ACTIONS(72), 1, + STATE(21), 1, + sym_comment, + ACTIONS(58), 5, + ts_builtin_sym_end, + sym_identifier, anon_sym_COMMA, - ACTIONS(74), 1, anon_sym_RBRACK, + anon_sym_RBRACE, + [451] = 3, + ACTIONS(3), 1, + anon_sym_POUND, STATE(22), 1, sym_comment, + ACTIONS(60), 5, + ts_builtin_sym_end, + sym_identifier, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_RBRACE, + [465] = 3, + ACTIONS(3), 1, + anon_sym_POUND, + STATE(23), 1, + sym_comment, + ACTIONS(62), 5, + ts_builtin_sym_end, + sym_identifier, + anon_sym_COMMA, + anon_sym_RBRACK, + anon_sym_RBRACE, + [479] = 7, + ACTIONS(3), 1, + anon_sym_POUND, + ACTIONS(7), 1, + sym_identifier, + ACTIONS(64), 1, + ts_builtin_sym_end, + STATE(11), 1, + aux_sym_source_file_repeat1, STATE(24), 1, - aux_sym_list_expression_repeat1, - [432] = 4, - ACTIONS(48), 1, + sym_comment, + STATE(38), 1, + sym__definition, + STATE(43), 1, + sym_assignment, + [501] = 5, + ACTIONS(66), 1, + anon_sym_POUND, + ACTIONS(68), 1, + aux_sym_interpreted_string_literal_token1, + ACTIONS(71), 1, + anon_sym_DQUOTE2, + ACTIONS(73), 1, + sym_escape_sequence, + STATE(25), 2, + sym_comment, + aux_sym_interpreted_string_literal_repeat1, + [518] = 6, + ACTIONS(66), 1, anon_sym_POUND, ACTIONS(76), 1, aux_sym_interpreted_string_literal_token1, - STATE(23), 1, - sym_comment, - ACTIONS(78), 2, + ACTIONS(78), 1, anon_sym_DQUOTE2, - sym_escape_sequence, - [446] = 5, - ACTIONS(3), 1, - anon_sym_POUND, - ACTIONS(23), 1, - anon_sym_RBRACK, ACTIONS(80), 1, - anon_sym_COMMA, - STATE(24), 1, - sym_comment, + sym_escape_sequence, STATE(25), 1, - aux_sym_list_expression_repeat1, - [462] = 4, - ACTIONS(3), 1, - anon_sym_POUND, - ACTIONS(82), 1, - anon_sym_COMMA, - ACTIONS(85), 1, - anon_sym_RBRACK, - STATE(25), 2, - sym_comment, - aux_sym_list_expression_repeat1, - [476] = 3, - ACTIONS(3), 1, - anon_sym_POUND, + aux_sym_interpreted_string_literal_repeat1, STATE(26), 1, sym_comment, - ACTIONS(87), 2, - ts_builtin_sym_end, - sym_identifier, - [487] = 3, - ACTIONS(3), 1, + [537] = 6, + ACTIONS(66), 1, anon_sym_POUND, + ACTIONS(76), 1, + aux_sym_interpreted_string_literal_token1, + ACTIONS(80), 1, + sym_escape_sequence, + ACTIONS(82), 1, + anon_sym_DQUOTE2, + STATE(26), 1, + aux_sym_interpreted_string_literal_repeat1, STATE(27), 1, sym_comment, - ACTIONS(89), 2, - ts_builtin_sym_end, - sym_identifier, - [498] = 3, + [556] = 5, ACTIONS(3), 1, anon_sym_POUND, + ACTIONS(84), 1, + sym_identifier, + ACTIONS(86), 1, + anon_sym_RBRACE, STATE(28), 1, sym_comment, - ACTIONS(91), 2, - ts_builtin_sym_end, - sym_identifier, - [509] = 3, + STATE(42), 1, + sym__colon_property, + [572] = 5, ACTIONS(3), 1, anon_sym_POUND, + ACTIONS(88), 1, + anon_sym_COMMA, + ACTIONS(90), 1, + anon_sym_RBRACE, STATE(29), 1, sym_comment, - ACTIONS(85), 2, - anon_sym_COMMA, - anon_sym_RBRACK, - [520] = 3, + STATE(30), 1, + aux_sym_map_expression_repeat1, + [588] = 4, ACTIONS(3), 1, anon_sym_POUND, - STATE(30), 1, - sym_comment, - ACTIONS(93), 2, - anon_sym_EQ, - anon_sym_PLUS_EQ, - [531] = 3, - ACTIONS(48), 1, - anon_sym_POUND, + ACTIONS(92), 1, + anon_sym_COMMA, ACTIONS(95), 1, - aux_sym_comment_token1, + anon_sym_RBRACE, + STATE(30), 2, + sym_comment, + aux_sym_map_expression_repeat1, + [602] = 5, + ACTIONS(3), 1, + anon_sym_POUND, + ACTIONS(84), 1, + sym_identifier, + ACTIONS(97), 1, + anon_sym_RBRACE, STATE(31), 1, sym_comment, - [541] = 3, + STATE(37), 1, + sym__colon_property, + [618] = 5, ACTIONS(3), 1, anon_sym_POUND, - ACTIONS(97), 1, - aux_sym_integer_literal_token1, + ACTIONS(27), 1, + anon_sym_RBRACK, + ACTIONS(99), 1, + anon_sym_COMMA, STATE(32), 1, sym_comment, - [551] = 3, + STATE(35), 1, + aux_sym_list_expression_repeat1, + [634] = 5, ACTIONS(3), 1, anon_sym_POUND, - ACTIONS(99), 1, - ts_builtin_sym_end, + ACTIONS(101), 1, + anon_sym_COMMA, + ACTIONS(103), 1, + anon_sym_RBRACK, + STATE(32), 1, + aux_sym_list_expression_repeat1, STATE(33), 1, sym_comment, - [561] = 1, - ACTIONS(101), 1, + [650] = 5, + ACTIONS(3), 1, + anon_sym_POUND, + ACTIONS(84), 1, + sym_identifier, + ACTIONS(105), 1, + anon_sym_RBRACE, + STATE(34), 1, + sym_comment, + STATE(42), 1, + sym__colon_property, + [666] = 4, + ACTIONS(3), 1, + anon_sym_POUND, + ACTIONS(107), 1, + anon_sym_COMMA, + ACTIONS(110), 1, + anon_sym_RBRACK, + STATE(35), 2, + sym_comment, + aux_sym_list_expression_repeat1, + [680] = 4, + ACTIONS(66), 1, + anon_sym_POUND, + ACTIONS(112), 1, + aux_sym_interpreted_string_literal_token1, + STATE(36), 1, + sym_comment, + ACTIONS(114), 2, + anon_sym_DQUOTE2, + sym_escape_sequence, + [694] = 5, + ACTIONS(3), 1, + anon_sym_POUND, + ACTIONS(116), 1, + anon_sym_COMMA, + ACTIONS(118), 1, + anon_sym_RBRACE, + STATE(29), 1, + aux_sym_map_expression_repeat1, + STATE(37), 1, + sym_comment, + [710] = 3, + ACTIONS(3), 1, + anon_sym_POUND, + STATE(38), 1, + sym_comment, + ACTIONS(120), 2, + ts_builtin_sym_end, + sym_identifier, + [721] = 3, + ACTIONS(3), 1, + anon_sym_POUND, + STATE(39), 1, + sym_comment, + ACTIONS(110), 2, + anon_sym_COMMA, + anon_sym_RBRACK, + [732] = 3, + ACTIONS(3), 1, + anon_sym_POUND, + STATE(40), 1, + sym_comment, + ACTIONS(122), 2, + anon_sym_COMMA, + anon_sym_RBRACE, + [743] = 3, + ACTIONS(3), 1, + anon_sym_POUND, + STATE(41), 1, + sym_comment, + ACTIONS(124), 2, + ts_builtin_sym_end, + sym_identifier, + [754] = 3, + ACTIONS(3), 1, + anon_sym_POUND, + STATE(42), 1, + sym_comment, + ACTIONS(126), 2, + anon_sym_COMMA, + anon_sym_RBRACE, + [765] = 3, + ACTIONS(3), 1, + anon_sym_POUND, + STATE(43), 1, + sym_comment, + ACTIONS(128), 2, + ts_builtin_sym_end, + sym_identifier, + [776] = 3, + ACTIONS(3), 1, + anon_sym_POUND, + STATE(44), 1, + sym_comment, + ACTIONS(130), 2, + anon_sym_EQ, + anon_sym_PLUS_EQ, + [787] = 4, + ACTIONS(3), 1, + anon_sym_POUND, + ACTIONS(84), 1, + sym_identifier, + STATE(42), 1, + sym__colon_property, + STATE(45), 1, + sym_comment, + [800] = 3, + ACTIONS(3), 1, + anon_sym_POUND, + ACTIONS(132), 1, + ts_builtin_sym_end, + STATE(46), 1, + sym_comment, + [810] = 3, + ACTIONS(66), 1, + anon_sym_POUND, + ACTIONS(134), 1, + aux_sym_comment_token1, + STATE(47), 1, + sym_comment, + [820] = 3, + ACTIONS(3), 1, + anon_sym_POUND, + ACTIONS(136), 1, + anon_sym_COLON, + STATE(48), 1, + sym_comment, + [830] = 3, + ACTIONS(3), 1, + anon_sym_POUND, + ACTIONS(138), 1, + aux_sym_integer_literal_token1, + STATE(49), 1, + sym_comment, + [840] = 1, + ACTIONS(140), 1, ts_builtin_sym_end, }; static const uint32_t ts_small_parse_table_map[] = { [SMALL_STATE(2)] = 0, - [SMALL_STATE(3)] = 39, - [SMALL_STATE(4)] = 78, - [SMALL_STATE(5)] = 117, - [SMALL_STATE(6)] = 153, - [SMALL_STATE(7)] = 189, - [SMALL_STATE(8)] = 209, - [SMALL_STATE(9)] = 231, - [SMALL_STATE(10)] = 244, - [SMALL_STATE(11)] = 257, - [SMALL_STATE(12)] = 270, - [SMALL_STATE(13)] = 283, - [SMALL_STATE(14)] = 296, - [SMALL_STATE(15)] = 309, - [SMALL_STATE(16)] = 322, - [SMALL_STATE(17)] = 341, - [SMALL_STATE(18)] = 354, - [SMALL_STATE(19)] = 367, - [SMALL_STATE(20)] = 384, - [SMALL_STATE(21)] = 397, - [SMALL_STATE(22)] = 416, - [SMALL_STATE(23)] = 432, - [SMALL_STATE(24)] = 446, - [SMALL_STATE(25)] = 462, - [SMALL_STATE(26)] = 476, - [SMALL_STATE(27)] = 487, - [SMALL_STATE(28)] = 498, - [SMALL_STATE(29)] = 509, - [SMALL_STATE(30)] = 520, - [SMALL_STATE(31)] = 531, - [SMALL_STATE(32)] = 541, - [SMALL_STATE(33)] = 551, - [SMALL_STATE(34)] = 561, + [SMALL_STATE(3)] = 43, + [SMALL_STATE(4)] = 86, + [SMALL_STATE(5)] = 129, + [SMALL_STATE(6)] = 169, + [SMALL_STATE(7)] = 209, + [SMALL_STATE(8)] = 249, + [SMALL_STATE(9)] = 263, + [SMALL_STATE(10)] = 277, + [SMALL_STATE(11)] = 291, + [SMALL_STATE(12)] = 311, + [SMALL_STATE(13)] = 325, + [SMALL_STATE(14)] = 339, + [SMALL_STATE(15)] = 353, + [SMALL_STATE(16)] = 367, + [SMALL_STATE(17)] = 381, + [SMALL_STATE(18)] = 395, + [SMALL_STATE(19)] = 409, + [SMALL_STATE(20)] = 423, + [SMALL_STATE(21)] = 437, + [SMALL_STATE(22)] = 451, + [SMALL_STATE(23)] = 465, + [SMALL_STATE(24)] = 479, + [SMALL_STATE(25)] = 501, + [SMALL_STATE(26)] = 518, + [SMALL_STATE(27)] = 537, + [SMALL_STATE(28)] = 556, + [SMALL_STATE(29)] = 572, + [SMALL_STATE(30)] = 588, + [SMALL_STATE(31)] = 602, + [SMALL_STATE(32)] = 618, + [SMALL_STATE(33)] = 634, + [SMALL_STATE(34)] = 650, + [SMALL_STATE(35)] = 666, + [SMALL_STATE(36)] = 680, + [SMALL_STATE(37)] = 694, + [SMALL_STATE(38)] = 710, + [SMALL_STATE(39)] = 721, + [SMALL_STATE(40)] = 732, + [SMALL_STATE(41)] = 743, + [SMALL_STATE(42)] = 754, + [SMALL_STATE(43)] = 765, + [SMALL_STATE(44)] = 776, + [SMALL_STATE(45)] = 787, + [SMALL_STATE(46)] = 800, + [SMALL_STATE(47)] = 810, + [SMALL_STATE(48)] = 820, + [SMALL_STATE(49)] = 830, + [SMALL_STATE(50)] = 840, }; 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}}, SHIFT(31), + [3] = {.entry = {.count = 1, .reusable = true}}, SHIFT(47), [5] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 0), - [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30), + [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(44), [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), - [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), + [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(49), [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), - [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), - [19] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), - [21] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), - [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), - [25] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), - [27] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), - [29] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(30), - [32] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), - [34] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interpreted_string_literal, 3), - [36] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_list_expression, 2), - [38] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_list_expression, 5), + [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), + [19] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2), + [21] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), + [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), + [25] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), + [27] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), + [29] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_list_expression, 4), + [31] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interpreted_string_literal, 3), + [33] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_map_expression, 5, .production_id = 4), + [35] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), + [37] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(44), [40] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__expr, 1), - [42] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_list_expression, 4), + [42] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_list_expression, 5), [44] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_integer_literal, 1), [46] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__string_literal, 1), - [48] = {.entry = {.count = 1, .reusable = false}}, SHIFT(31), - [50] = {.entry = {.count = 1, .reusable = false}}, SHIFT(23), - [52] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), - [54] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), + [48] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_map_expression, 4, .production_id = 4), + [50] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_map_expression, 4, .production_id = 2), + [52] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_map_expression, 3, .production_id = 2), + [54] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_integer_literal, 2), [56] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_list_expression, 3), - [58] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_integer_literal, 2), - [60] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_interpreted_string_literal_repeat1, 2), SHIFT_REPEAT(23), - [63] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_interpreted_string_literal_repeat1, 2), - [65] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_interpreted_string_literal_repeat1, 2), SHIFT_REPEAT(23), - [68] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interpreted_string_literal, 2), - [70] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), - [72] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3), - [74] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), - [76] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_interpreted_string_literal_repeat1, 1), - [78] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_interpreted_string_literal_repeat1, 1), - [80] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2), - [82] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_list_expression_repeat1, 2), SHIFT_REPEAT(6), - [85] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_expression_repeat1, 2), - [87] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__definition, 1), - [89] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 1), - [91] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assignment, 3, .production_id = 1), - [93] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), - [95] = {.entry = {.count = 1, .reusable = false}}, SHIFT(34), - [97] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), - [99] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), - [101] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comment, 2), + [58] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interpreted_string_literal, 2), + [60] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_map_expression, 2), + [62] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_list_expression, 2), + [64] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1), + [66] = {.entry = {.count = 1, .reusable = false}}, SHIFT(47), + [68] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_interpreted_string_literal_repeat1, 2), SHIFT_REPEAT(36), + [71] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_interpreted_string_literal_repeat1, 2), + [73] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_interpreted_string_literal_repeat1, 2), SHIFT_REPEAT(36), + [76] = {.entry = {.count = 1, .reusable = false}}, SHIFT(36), + [78] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), + [80] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), + [82] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), + [84] = {.entry = {.count = 1, .reusable = true}}, SHIFT(48), + [86] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), + [88] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28), + [90] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), + [92] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_map_expression_repeat1, 2, .production_id = 5), SHIFT_REPEAT(45), + [95] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_map_expression_repeat1, 2, .production_id = 5), + [97] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), + [99] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3), + [101] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), + [103] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), + [105] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), + [107] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_list_expression_repeat1, 2), SHIFT_REPEAT(5), + [110] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_list_expression_repeat1, 2), + [112] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_interpreted_string_literal_repeat1, 1), + [114] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_interpreted_string_literal_repeat1, 1), + [116] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), + [118] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), + [120] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 1), + [122] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__colon_property, 3, .production_id = 3), + [124] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assignment, 3, .production_id = 1), + [126] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_map_expression_repeat1, 2, .production_id = 2), + [128] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__definition, 1), + [130] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), + [132] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [134] = {.entry = {.count = 1, .reusable = false}}, SHIFT(50), + [136] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), + [138] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), + [140] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comment, 2), }; #ifdef __cplusplus diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt index a3270a7..f45bb0d 100644 --- a/test/corpus/expressions.txt +++ b/test/corpus/expressions.txt @@ -186,3 +186,120 @@ foo = [ (identifier) (list_expression (ERROR)))) + +================================================================================ +Map (empty) +================================================================================ + +foo = {} + +-------------------------------------------------------------------------------- + +(source_file + (assignment + (identifier) + (map_expression))) + +================================================================================ +Map (singleton) +================================================================================ + +foo = {foo:42} + +-------------------------------------------------------------------------------- + +(source_file + (assignment + (identifier) + (map_expression + (identifier) + (integer_literal)))) + +================================================================================ +Map (singleton multiline) +================================================================================ + +foo = { + foo: 42 +} + +-------------------------------------------------------------------------------- + +(source_file + (assignment + (identifier) + (map_expression + (identifier) + (integer_literal)))) + +================================================================================ +Map (singleton trailing comma) +================================================================================ + +foo = { + foo: 42, +} + +-------------------------------------------------------------------------------- + +(source_file + (assignment + (identifier) + (map_expression + (identifier) + (integer_literal)))) + +================================================================================ +Map (mixed values) +================================================================================ + +foo = { + answer: 42, + value: "foobar", +} + +-------------------------------------------------------------------------------- + +(source_file + (assignment + (identifier) + (map_expression + (identifier) + (integer_literal) + (identifier) + (interpreted_string_literal)))) + +================================================================================ +Map (map of map) +================================================================================ + +foo = { + the: {answer: 42}, +} + +-------------------------------------------------------------------------------- + +(source_file + (assignment + (identifier) + (map_expression + (identifier) + (map_expression + (identifier) + (integer_literal))))) + +================================================================================ +Map (rogue comma) +================================================================================ + +foo = { + , +} + +-------------------------------------------------------------------------------- + +(source_file + (assignment + (identifier) + (map_expression + (ERROR))))