diff --git a/grammar.js b/grammar.js index ce62fe5..fb69e4c 100644 --- a/grammar.js +++ b/grammar.js @@ -462,9 +462,9 @@ module.exports = grammar({ type_alias_statement: $ => prec.dynamic(1, seq( 'type', - $.type, + field('left', $.type), '=', - $.type, + field('right', $.type), )), class_definition: $ => seq( diff --git a/src/grammar.json b/src/grammar.json index 16d4baf..2507360 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -1872,16 +1872,24 @@ "value": "type" }, { - "type": "SYMBOL", - "name": "type" + "type": "FIELD", + "name": "left", + "content": { + "type": "SYMBOL", + "name": "type" + } }, { "type": "STRING", "value": "=" }, { - "type": "SYMBOL", - "name": "type" + "type": "FIELD", + "name": "right", + "content": { + "type": "SYMBOL", + "name": "type" + } } ] } diff --git a/src/node-types.json b/src/node-types.json index 5d307ac..9be3e5e 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -2998,16 +2998,27 @@ { "type": "type_alias_statement", "named": true, - "fields": {}, - "children": { - "multiple": true, - "required": true, - "types": [ - { - "type": "type", - "named": true - } - ] + "fields": { + "left": { + "multiple": false, + "required": true, + "types": [ + { + "type": "type", + "named": true + } + ] + }, + "right": { + "multiple": false, + "required": true, + "types": [ + { + "type": "type", + "named": true + } + ] + } } }, { diff --git a/src/parser.c b/src/parser.c index 1f98bb3..f95d547 100644 --- a/src/parser.c +++ b/src/parser.c @@ -2068,36 +2068,36 @@ static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { [43] = {.index = 57, .length = 1}, [44] = {.index = 58, .length = 2}, [45] = {.index = 60, .length = 2}, - [46] = {.index = 62, .length = 1}, - [47] = {.index = 63, .length = 2}, + [46] = {.index = 62, .length = 2}, + [47] = {.index = 64, .length = 1}, [48] = {.index = 65, .length = 2}, - [50] = {.index = 67, .length = 2}, + [49] = {.index = 67, .length = 2}, [51] = {.index = 69, .length = 2}, - [52] = {.index = 71, .length = 1}, - [53] = {.index = 72, .length = 3}, - [54] = {.index = 75, .length = 3}, - [55] = {.index = 78, .length = 3}, - [56] = {.index = 81, .length = 3}, - [57] = {.index = 84, .length = 4}, - [58] = {.index = 88, .length = 1}, - [59] = {.index = 89, .length = 3}, - [60] = {.index = 92, .length = 3}, - [61] = {.index = 95, .length = 2}, + [52] = {.index = 71, .length = 2}, + [53] = {.index = 73, .length = 1}, + [54] = {.index = 74, .length = 3}, + [55] = {.index = 77, .length = 3}, + [56] = {.index = 80, .length = 3}, + [57] = {.index = 83, .length = 3}, + [58] = {.index = 86, .length = 4}, + [59] = {.index = 90, .length = 1}, + [60] = {.index = 91, .length = 3}, + [61] = {.index = 94, .length = 3}, [62] = {.index = 97, .length = 2}, - [63] = {.index = 99, .length = 3}, - [64] = {.index = 102, .length = 3}, - [65] = {.index = 105, .length = 3}, - [66] = {.index = 108, .length = 3}, - [67] = {.index = 111, .length = 3}, - [68] = {.index = 18, .length = 2}, - [69] = {.index = 114, .length = 1}, - [70] = {.index = 115, .length = 3}, - [71] = {.index = 118, .length = 2}, + [63] = {.index = 99, .length = 2}, + [64] = {.index = 101, .length = 3}, + [65] = {.index = 104, .length = 3}, + [66] = {.index = 107, .length = 3}, + [67] = {.index = 110, .length = 3}, + [68] = {.index = 113, .length = 3}, + [69] = {.index = 18, .length = 2}, + [70] = {.index = 116, .length = 1}, + [71] = {.index = 117, .length = 3}, [72] = {.index = 120, .length = 2}, [73] = {.index = 122, .length = 2}, - [74] = {.index = 124, .length = 3}, - [75] = {.index = 127, .length = 1}, - [76] = {.index = 128, .length = 2}, + [74] = {.index = 124, .length = 2}, + [75] = {.index = 126, .length = 3}, + [76] = {.index = 129, .length = 1}, [77] = {.index = 130, .length = 2}, [78] = {.index = 132, .length = 4}, [79] = {.index = 136, .length = 2}, @@ -2256,111 +2256,111 @@ static const TSFieldMapEntry ts_field_map_entries[] = { [57] = {field_body, 3}, [58] = + {field_left, 1}, + {field_right, 3}, + [60] = {field_body, 3}, {field_name, 1}, - [60] = + [62] = {field_key, 0}, {field_value, 2}, - [62] = + [64] = {field_type, 2}, - [63] = + [65] = {field_body, 3}, {field_parameters, 1}, - [65] = + [67] = {field_subscript, 2}, {field_value, 0}, - [67] = + [69] = {field_expression, 1}, {field_type_conversion, 2}, - [69] = + [71] = {field_expression, 1}, {field_format_specifier, 2}, - [71] = + [73] = {field_alternative, 0}, - [72] = + [74] = {field_alternative, 4}, {field_condition, 1}, {field_consequence, 3}, - [75] = + [77] = {field_alternative, 4, .inherited = true}, {field_condition, 1}, {field_consequence, 3}, - [78] = + [80] = {field_condition, 1}, {field_consequence, 3}, {field_consequence, 4}, - [81] = + [83] = {field_alternative, 4, .inherited = true}, {field_body, 4}, {field_subject, 1}, - [84] = + [86] = {field_alternative, 4, .inherited = true}, {field_body, 4}, {field_subject, 1}, {field_subject, 2, .inherited = true}, - [88] = + [90] = {field_body, 4}, - [89] = + [91] = {field_alternative, 4}, {field_body, 3}, {field_condition, 1}, - [92] = + [94] = {field_body, 3}, {field_body, 4}, {field_condition, 1}, - [95] = + [97] = {field_body, 2}, {field_body, 3}, - [97] = + [99] = {field_body, 3}, {field_body, 4}, - [99] = + [101] = {field_body, 4}, {field_name, 1}, {field_parameters, 2}, - [102] = + [104] = {field_body, 3}, {field_body, 4}, {field_name, 1}, - [105] = + [107] = {field_body, 4}, {field_name, 1}, {field_type_parameters, 2}, - [108] = + [110] = {field_body, 4}, {field_name, 1}, {field_superclasses, 2}, - [111] = + [113] = {field_left, 0}, {field_right, 4}, {field_type, 2}, - [114] = + [116] = {field_subscript, 1}, - [115] = + [117] = {field_subscript, 2}, {field_subscript, 3, .inherited = true}, {field_value, 0}, - [118] = + [120] = {field_subscript, 0, .inherited = true}, {field_subscript, 1, .inherited = true}, - [120] = + [122] = {field_expression, 1}, {field_type_conversion, 3}, - [122] = + [124] = {field_expression, 1}, {field_format_specifier, 3}, - [124] = + [126] = {field_expression, 1}, {field_format_specifier, 3}, {field_type_conversion, 2}, - [127] = + [129] = {field_name, 4, .inherited = true}, - [128] = + [130] = {field_module_name, 1}, {field_name, 4, .inherited = true}, - [130] = - {field_left, 1}, - {field_right, 3}, [132] = {field_alternative, 4, .inherited = true}, {field_alternative, 5}, @@ -2647,34 +2647,34 @@ static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE [43] = { [3] = sym_block, }, - [44] = { + [45] = { [3] = sym_block, }, - [49] = { + [50] = { [0] = alias_sym_format_expression, }, - [53] = { + [54] = { [3] = sym_block, }, - [54] = { + [55] = { [3] = sym_block, }, - [58] = { + [59] = { [4] = sym_block, }, - [59] = { + [60] = { [3] = sym_block, }, - [63] = { + [64] = { [4] = sym_block, }, - [65] = { + [66] = { [4] = sym_block, }, - [66] = { + [67] = { [4] = sym_block, }, - [68] = { + [69] = { [0] = sym_identifier, }, [78] = { @@ -127449,8 +127449,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [1263] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__collection_elements, 3, 0, 0), [1265] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression_list, 3, 0, 0), [1267] = {.entry = {.count = 1, .reusable = true}}, SHIFT(915), - [1269] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_for_in_clause, 5, 0, 77), - [1271] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_for_in_clause, 5, 0, 77), + [1269] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_for_in_clause, 5, 0, 44), + [1271] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_for_in_clause, 5, 0, 44), [1273] = {.entry = {.count = 1, .reusable = false}}, SHIFT(1636), [1275] = {.entry = {.count = 1, .reusable = true}}, SHIFT(303), [1277] = {.entry = {.count = 1, .reusable = true}}, SHIFT(582), @@ -127555,8 +127555,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [1475] = {.entry = {.count = 1, .reusable = true}}, SHIFT(115), [1477] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2471), [1479] = {.entry = {.count = 1, .reusable = true}}, SHIFT(91), - [1481] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_try_statement, 5, 0, 61), - [1483] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_try_statement, 5, 0, 61), + [1481] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_try_statement, 5, 0, 62), + [1483] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_try_statement, 5, 0, 62), [1485] = {.entry = {.count = 1, .reusable = false}}, SHIFT(2658), [1487] = {.entry = {.count = 1, .reusable = false}}, SHIFT(475), [1489] = {.entry = {.count = 1, .reusable = false}}, SHIFT(2734), @@ -127599,13 +127599,13 @@ static const TSParseActionEntry ts_parse_actions[] = { [1565] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if_statement, 6, 0, 81), [1567] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_statement, 6, 0, 81), [1569] = {.entry = {.count = 1, .reusable = false}}, SHIFT(606), - [1571] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_statement, 5, 0, 55), - [1573] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if_statement, 5, 0, 55), + [1571] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_statement, 5, 0, 56), + [1573] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if_statement, 5, 0, 56), [1575] = {.entry = {.count = 1, .reusable = false}}, SHIFT(608), [1577] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if_statement, 4, 0, 37), [1579] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_statement, 4, 0, 37), - [1581] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_statement, 5, 0, 54), - [1583] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if_statement, 5, 0, 54), + [1581] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_statement, 5, 0, 55), + [1583] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if_statement, 5, 0, 55), [1585] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_try_statement_repeat1, 2, 0, 0), [1587] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_try_statement_repeat1, 2, 0, 0), [1589] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_try_statement_repeat1, 2, 0, 0), SHIFT_REPEAT(475), @@ -127639,14 +127639,14 @@ static const TSParseActionEntry ts_parse_actions[] = { [1655] = {.entry = {.count = 2, .reusable = false}}, REDUCE(sym_primary_expression, 1, 0, 0), REDUCE(sym_list_splat_pattern, 2, 0, 0), [1658] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_list_splat_pattern, 2, 0, 0), [1660] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_splat_type, 2, 0, 0), - [1662] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_subscript, 5, 0, 48), - [1664] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_subscript, 5, 0, 48), - [1666] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_subscript, 6, 0, 70), - [1668] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_subscript, 6, 0, 70), - [1670] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_subscript, 4, 0, 48), - [1672] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_subscript, 4, 0, 48), - [1674] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_subscript, 5, 0, 70), - [1676] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_subscript, 5, 0, 70), + [1662] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_subscript, 5, 0, 49), + [1664] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_subscript, 5, 0, 49), + [1666] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_subscript, 6, 0, 71), + [1668] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_subscript, 6, 0, 71), + [1670] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_subscript, 4, 0, 49), + [1672] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_subscript, 4, 0, 49), + [1674] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_subscript, 5, 0, 71), + [1676] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_subscript, 5, 0, 71), [1678] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_except_group_clause, 4, 0, 104), [1680] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_except_group_clause, 4, 0, 104), [1682] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__simple_statements, 2, 0, 0), @@ -127686,20 +127686,20 @@ static const TSParseActionEntry ts_parse_actions[] = { [1750] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_except_group_clause, 7, 0, 0), [1752] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_while_statement, 4, 0, 41), [1754] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_while_statement, 4, 0, 41), - [1756] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_if_statement_repeat1, 1, 0, 52), - [1758] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_if_statement_repeat1, 1, 0, 52), + [1756] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_if_statement_repeat1, 1, 0, 53), + [1758] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_if_statement_repeat1, 1, 0, 53), [1760] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_for_statement, 7, 0, 103), [1762] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_for_statement, 7, 0, 103), [1764] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_for_statement, 6, 0, 86), [1766] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_for_statement, 6, 0, 86), [1768] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_try_statement, 5, 0, 42), [1770] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_try_statement, 5, 0, 42), - [1772] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_try_statement, 6, 0, 61), - [1774] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_try_statement, 6, 0, 61), - [1776] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_while_statement, 5, 0, 60), - [1778] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_while_statement, 5, 0, 60), - [1780] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_elif_clause, 5, 0, 55), - [1782] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_elif_clause, 5, 0, 55), + [1772] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_try_statement, 6, 0, 62), + [1774] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_try_statement, 6, 0, 62), + [1776] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_while_statement, 5, 0, 61), + [1778] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_while_statement, 5, 0, 61), + [1780] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_elif_clause, 5, 0, 56), + [1782] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_elif_clause, 5, 0, 56), [1784] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_for_statement, 8, 0, 112), [1786] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_for_statement, 8, 0, 112), [1788] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_elif_clause, 4, 0, 37), @@ -127714,15 +127714,15 @@ static const TSParseActionEntry ts_parse_actions[] = { [1806] = {.entry = {.count = 1, .reusable = false}}, SHIFT(1602), [1808] = {.entry = {.count = 1, .reusable = true}}, SHIFT(202), [1810] = {.entry = {.count = 1, .reusable = false}}, SHIFT(446), - [1812] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_else_clause, 4, 0, 61), - [1814] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_else_clause, 4, 0, 61), + [1812] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_else_clause, 4, 0, 62), + [1814] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_else_clause, 4, 0, 62), [1816] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2304), [1818] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_else_clause, 3, 0, 42), [1820] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_else_clause, 3, 0, 42), [1822] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_definition, 8, 0, 113), [1824] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_definition, 8, 0, 113), - [1826] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_match_statement, 5, 0, 57), - [1828] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_match_statement, 5, 0, 57), + [1826] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_match_statement, 5, 0, 58), + [1828] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_match_statement, 5, 0, 58), [1830] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_definition, 8, 0, 117), [1832] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_definition, 8, 0, 117), [1834] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_statement, 6, 0, 78), @@ -127769,12 +127769,12 @@ static const TSParseActionEntry ts_parse_actions[] = { [1916] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_class_definition, 6, 0, 93), [1918] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_definition, 10, 0, 133), [1920] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_definition, 10, 0, 133), - [1922] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_with_statement, 5, 0, 62), - [1924] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_with_statement, 5, 0, 62), + [1922] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_with_statement, 5, 0, 63), + [1924] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_with_statement, 5, 0, 63), [1926] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_statement, 7, 0, 98), [1928] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if_statement, 7, 0, 98), - [1930] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_with_statement, 5, 0, 58), - [1932] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_with_statement, 5, 0, 58), + [1930] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_with_statement, 5, 0, 59), + [1932] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_with_statement, 5, 0, 59), [1934] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_definition, 7, 0, 100), [1936] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_definition, 7, 0, 100), [1938] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_definition, 7, 0, 101), @@ -127785,8 +127785,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [1948] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_definition, 8, 0, 114), [1950] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_finally_clause, 4, 0, 0), [1952] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_finally_clause, 4, 0, 0), - [1954] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_try_statement, 7, 0, 61), - [1956] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_try_statement, 7, 0, 61), + [1954] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_try_statement, 7, 0, 62), + [1956] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_try_statement, 7, 0, 62), [1958] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_definition, 7, 0, 105), [1960] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_definition, 7, 0, 105), [1962] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_definition, 7, 0, 106), @@ -127804,15 +127804,15 @@ static const TSParseActionEntry ts_parse_actions[] = { [1986] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_match_statement, 4, 0, 39), [1988] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_definition, 8, 0, 116), [1990] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_definition, 8, 0, 116), - [1992] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_definition, 5, 0, 63), - [1994] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_definition, 5, 0, 63), + [1992] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_definition, 5, 0, 64), + [1994] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_definition, 5, 0, 64), [1996] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__patterns, 2, 0, 0), - [1998] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_statement, 5, 0, 53), - [2000] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if_statement, 5, 0, 53), + [1998] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_statement, 5, 0, 54), + [2000] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if_statement, 5, 0, 54), [2002] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_with_statement, 4, 0, 43), [2004] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_with_statement, 4, 0, 43), - [2006] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_definition, 4, 0, 44), - [2008] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_class_definition, 4, 0, 44), + [2006] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_definition, 4, 0, 45), + [2008] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_class_definition, 4, 0, 45), [2010] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_decorated_definition, 2, 0, 12), [2012] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_decorated_definition, 2, 0, 12), [2014] = {.entry = {.count = 1, .reusable = false}}, SHIFT(1597), @@ -127822,17 +127822,17 @@ static const TSParseActionEntry ts_parse_actions[] = { [2022] = {.entry = {.count = 1, .reusable = false}}, SHIFT(1595), [2024] = {.entry = {.count = 1, .reusable = true}}, SHIFT(212), [2026] = {.entry = {.count = 1, .reusable = false}}, SHIFT(422), - [2028] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_definition, 5, 0, 66), - [2030] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_class_definition, 5, 0, 66), + [2028] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_definition, 5, 0, 67), + [2030] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_class_definition, 5, 0, 67), [2032] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_pattern_list, 3, 0, 0), - [2034] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_match_statement, 5, 0, 56), - [2036] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_match_statement, 5, 0, 56), - [2038] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_while_statement, 5, 0, 59), - [2040] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_while_statement, 5, 0, 59), - [2042] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_definition, 5, 0, 64), - [2044] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_class_definition, 5, 0, 64), - [2046] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_definition, 5, 0, 65), - [2048] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_class_definition, 5, 0, 65), + [2034] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_match_statement, 5, 0, 57), + [2036] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_match_statement, 5, 0, 57), + [2038] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_while_statement, 5, 0, 60), + [2040] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_while_statement, 5, 0, 60), + [2042] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_definition, 5, 0, 65), + [2044] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_class_definition, 5, 0, 65), + [2046] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_definition, 5, 0, 66), + [2048] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_class_definition, 5, 0, 66), [2050] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__match_block, 2, 0, 0), [2052] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__match_block, 2, 0, 0), [2054] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_pattern_list, 2, 0, 0), @@ -128280,7 +128280,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [2973] = {.entry = {.count = 1, .reusable = true}}, SHIFT(573), [2975] = {.entry = {.count = 1, .reusable = true}}, SHIFT(574), [2977] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_boolean_operator, 3, 0, 21), - [2979] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_lambda, 4, 0, 47), + [2979] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_lambda, 4, 0, 48), [2981] = {.entry = {.count = 1, .reusable = true}}, SHIFT(569), [2983] = {.entry = {.count = 1, .reusable = true}}, SHIFT(570), [2985] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_lambda, 3, 0, 17), @@ -128412,7 +128412,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [3250] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2752), [3252] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2772), [3254] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2761), - [3256] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pair, 3, 0, 45), + [3256] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pair, 3, 0, 46), [3258] = {.entry = {.count = 1, .reusable = true}}, SHIFT(374), [3260] = {.entry = {.count = 1, .reusable = true}}, SHIFT(644), [3262] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2787), @@ -128455,7 +128455,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [3338] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_dotted_name_repeat1, 2, 0, 0), SHIFT_REPEAT(2719), [3341] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__comprehension_clauses, 1, 0, 0), [3343] = {.entry = {.count = 1, .reusable = true}}, SHIFT(548), - [3345] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_subscript_repeat1, 2, 0, 69), + [3345] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_subscript_repeat1, 2, 0, 70), [3347] = {.entry = {.count = 1, .reusable = true}}, SHIFT(357), [3349] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1185), [3351] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2522), @@ -128504,8 +128504,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [3447] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__comprehension_clauses_repeat1, 2, 0, 0), SHIFT_REPEAT(844), [3450] = {.entry = {.count = 1, .reusable = true}}, SHIFT(350), [3452] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1310), - [3454] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interpolation, 4, 0, 51), - [3456] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_interpolation, 4, 0, 51), + [3454] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interpolation, 4, 0, 52), + [3456] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_interpolation, 4, 0, 52), [3458] = {.entry = {.count = 1, .reusable = true}}, SHIFT(328), [3460] = {.entry = {.count = 1, .reusable = true}}, SHIFT(345), [3462] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_for_in_clause, 6, 0, 108), @@ -128517,7 +128517,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [3474] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1556), [3476] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_parameter, 4, 0, 0), [3478] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2748), - [3480] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_for_in_clause, 4, 0, 77), + [3480] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_for_in_clause, 4, 0, 44), [3482] = {.entry = {.count = 1, .reusable = true}}, SHIFT(336), [3484] = {.entry = {.count = 1, .reusable = true}}, SHIFT(338), [3486] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_for_in_clause, 5, 0, 96), @@ -128532,7 +128532,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [3504] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_list_splat, 2, 0, 0), [3506] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1508), [3508] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_slice, 5, 0, 0), - [3510] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_keyword_argument, 3, 0, 68), + [3510] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_keyword_argument, 3, 0, 69), [3512] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1486), [3514] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2769), [3516] = {.entry = {.count = 1, .reusable = true}}, SHIFT(565), @@ -128547,15 +128547,15 @@ static const TSParseActionEntry ts_parse_actions[] = { [3535] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1990), [3537] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interpolation, 3, 0, 26), [3539] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_interpolation, 3, 0, 26), - [3541] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interpolation, 5, 0, 72), - [3543] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_interpolation, 5, 0, 72), + [3541] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interpolation, 5, 0, 73), + [3543] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_interpolation, 5, 0, 73), [3545] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_raise_statement, 3, 0, 16), [3547] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_for_in_clause_repeat1, 2, 0, 0), SHIFT_REPEAT(456), [3550] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_for_in_clause_repeat1, 2, 0, 0), [3552] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_with_item, 1, 1, 7), [3554] = {.entry = {.count = 1, .reusable = true}}, SHIFT(656), - [3556] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interpolation, 5, 0, 73), - [3558] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_interpolation, 5, 0, 73), + [3556] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interpolation, 5, 0, 74), + [3558] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_interpolation, 5, 0, 74), [3560] = {.entry = {.count = 1, .reusable = true}}, SHIFT(339), [3562] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_for_in_clause, 5, 0, 97), [3564] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2597), @@ -128597,15 +128597,15 @@ static const TSParseActionEntry ts_parse_actions[] = { [3642] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2629), [3644] = {.entry = {.count = 1, .reusable = true}}, SHIFT(244), [3646] = {.entry = {.count = 1, .reusable = true}}, SHIFT(245), - [3648] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interpolation, 5, 0, 74), - [3650] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_interpolation, 5, 0, 74), - [3652] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interpolation, 4, 0, 50), - [3654] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_interpolation, 4, 0, 50), + [3648] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interpolation, 5, 0, 75), + [3650] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_interpolation, 5, 0, 75), + [3652] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interpolation, 4, 0, 51), + [3654] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_interpolation, 4, 0, 51), [3656] = {.entry = {.count = 1, .reusable = true}}, SHIFT(326), [3658] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assignment, 3, 0, 19), [3660] = {.entry = {.count = 1, .reusable = true}}, SHIFT(198), [3662] = {.entry = {.count = 1, .reusable = true}}, SHIFT(335), - [3664] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_typed_parameter, 3, 0, 46), + [3664] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_typed_parameter, 3, 0, 47), [3666] = {.entry = {.count = 1, .reusable = true}}, SHIFT(544), [3668] = {.entry = {.count = 1, .reusable = true}}, SHIFT(224), [3670] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2069), @@ -128613,7 +128613,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [3674] = {.entry = {.count = 1, .reusable = true}}, SHIFT(337), [3676] = {.entry = {.count = 1, .reusable = true}}, SHIFT(513), [3678] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1557), - [3680] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_alias_statement, 4, 1, 0), + [3680] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_type_alias_statement, 4, 1, 44), [3682] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_lambda_within_for_in_clause, 3, 0, 17), [3684] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2044), [3686] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2125), @@ -128639,7 +128639,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [3726] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_assert_statement_repeat1, 2, 0, 0), SHIFT_REPEAT(497), [3729] = {.entry = {.count = 1, .reusable = true}}, SHIFT(234), [3731] = {.entry = {.count = 1, .reusable = true}}, SHIFT(106), - [3733] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_lambda_within_for_in_clause, 4, 0, 47), + [3733] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_lambda_within_for_in_clause, 4, 0, 48), [3735] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__tuple_pattern, 4, 0, 0), [3737] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__list_pattern, 4, 0, 0), [3739] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_union_pattern_repeat1, 2, 0, 0), SHIFT_REPEAT(1557), @@ -128933,7 +128933,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [4337] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2200), [4339] = {.entry = {.count = 1, .reusable = true}}, SHIFT(319), [4341] = {.entry = {.count = 1, .reusable = true}}, SHIFT(320), - [4343] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__key_value_pattern, 3, 0, 45), + [4343] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__key_value_pattern, 3, 0, 46), [4345] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2640), [4347] = {.entry = {.count = 1, .reusable = true}}, SHIFT(393), [4349] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1343), @@ -128948,8 +128948,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [4368] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1505), [4370] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1533), [4372] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2220), - [4374] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_subscript_repeat1, 2, 0, 71), SHIFT_REPEAT(410), - [4377] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_subscript_repeat1, 2, 0, 71), + [4374] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_subscript_repeat1, 2, 0, 72), SHIFT_REPEAT(410), + [4377] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_subscript_repeat1, 2, 0, 72), [4379] = {.entry = {.count = 1, .reusable = true}}, SHIFT(396), [4381] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1428), [4383] = {.entry = {.count = 1, .reusable = true}}, SHIFT(397), @@ -128971,8 +128971,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [4417] = {.entry = {.count = 1, .reusable = true}}, SHIFT(428), [4419] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__patterns_repeat1, 2, 0, 0), SHIFT_REPEAT(854), [4422] = {.entry = {.count = 1, .reusable = true}}, SHIFT(427), - [4424] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_format_specifier_repeat1, 1, 0, 49), - [4426] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_format_specifier_repeat1, 1, 0, 49), + [4424] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_format_specifier_repeat1, 1, 0, 50), + [4426] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_format_specifier_repeat1, 1, 0, 50), [4428] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__collection_elements_repeat1, 2, 0, 0), SHIFT_REPEAT(356), [4431] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__collection_elements_repeat1, 2, 0, 0), SHIFT_REPEAT(369), [4434] = {.entry = {.count = 1, .reusable = true}}, SHIFT(132), @@ -129052,10 +129052,10 @@ static const TSParseActionEntry ts_parse_actions[] = { [4587] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_case_clause, 6, 0, 130), [4589] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_case_clause, 6, 0, 131), [4591] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_case_clause, 6, 0, 132), - [4593] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_future_import_statement, 6, 0, 75), + [4593] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_future_import_statement, 6, 0, 76), [4595] = {.entry = {.count = 1, .reusable = true}}, SHIFT(107), [4597] = {.entry = {.count = 1, .reusable = true}}, SHIFT(255), - [4599] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_import_from_statement, 6, 0, 76), + [4599] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_import_from_statement, 6, 0, 77), [4601] = {.entry = {.count = 1, .reusable = false}}, SHIFT(2008), [4603] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2008), [4605] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_case_clause, 7, 0, 134), @@ -129104,11 +129104,11 @@ static const TSParseActionEntry ts_parse_actions[] = { [4691] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_case_clause, 5, 0, 123), [4693] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_argument_list_repeat1, 2, 0, 33), [4695] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assignment, 3, 0, 20), - [4697] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assignment, 5, 0, 67), + [4697] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assignment, 5, 0, 68), [4699] = {.entry = {.count = 1, .reusable = false}}, SHIFT(2174), [4701] = {.entry = {.count = 1, .reusable = false}}, SHIFT(2126), [4703] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2126), - [4705] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym__match_block_repeat1, 1, 0, 52), + [4705] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym__match_block_repeat1, 1, 0, 53), [4707] = {.entry = {.count = 1, .reusable = false}}, SHIFT(1939), [4709] = {.entry = {.count = 1, .reusable = true}}, SHIFT(1939), [4711] = {.entry = {.count = 1, .reusable = false}}, SHIFT(2204), diff --git a/src/tree_sitter/array.h b/src/tree_sitter/array.h index 15a3b23..a17a574 100644 --- a/src/tree_sitter/array.h +++ b/src/tree_sitter/array.h @@ -14,6 +14,7 @@ extern "C" { #include #ifdef _MSC_VER +#pragma warning(push) #pragma warning(disable : 4101) #elif defined(__GNUC__) || defined(__clang__) #pragma GCC diagnostic push @@ -278,7 +279,7 @@ static inline void _array__splice(Array *self, size_t element_size, #define _compare_int(a, b) ((int)*(a) - (int)(b)) #ifdef _MSC_VER -#pragma warning(default : 4101) +#pragma warning(pop) #elif defined(__GNUC__) || defined(__clang__) #pragma GCC diagnostic pop #endif diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt index 2b1c950..d8c835f 100644 --- a/test/corpus/expressions.txt +++ b/test/corpus/expressions.txt @@ -400,6 +400,7 @@ Math operators ================================================================================ a + b * c ** d - e / 5 +a // 2 -5 +x ~x @@ -419,6 +420,10 @@ a + b * c ** d - e / 5 (binary_operator (identifier) (integer)))) + (expression_statement + (binary_operator + (identifier) + (integer))) (expression_statement (unary_operator (integer))) @@ -519,7 +524,7 @@ a() + b[c] * c.d.e Bitwise operators ================================================================================ -a << b | c >> d & e +a << b | c >> d & e ^ f -------------------------------------------------------------------------------- @@ -533,7 +538,9 @@ a << b | c >> d & e (binary_operator (identifier) (identifier)) - (identifier))))) + (binary_operator + (identifier) + (identifier)))))) ================================================================================ Boolean operators @@ -579,6 +586,8 @@ a < b <= c == d >= e > f not a == b or c == d a not in b a is not b +a is b and c != d +a <> b -------------------------------------------------------------------------------- @@ -604,6 +613,18 @@ a is not b (comparison_operator (identifier) (identifier))) + (expression_statement + (comparison_operator + (identifier) + (identifier))) + (expression_statement + (boolean_operator + (comparison_operator + (identifier) + (identifier)) + (comparison_operator + (identifier) + (identifier)))) (expression_statement (comparison_operator (identifier) @@ -697,6 +718,16 @@ Augmented assignments a += 1 b >>= 2 c //= 1 +d @= e +f -= 2 +g %= 2 +h /= 5 +i *= 2.2 +j &= 1 +k ^= 0 +l <<= 2 +m |= k +n **= 3 -------------------------------------------------------------------------------- @@ -709,6 +740,46 @@ c //= 1 (augmented_assignment (identifier) (integer))) + (expression_statement + (augmented_assignment + (identifier) + (integer))) + (expression_statement + (augmented_assignment + (identifier) + (identifier))) + (expression_statement + (augmented_assignment + (identifier) + (integer))) + (expression_statement + (augmented_assignment + (identifier) + (integer))) + (expression_statement + (augmented_assignment + (identifier) + (integer))) + (expression_statement + (augmented_assignment + (identifier) + (float))) + (expression_statement + (augmented_assignment + (identifier) + (integer))) + (expression_statement + (augmented_assignment + (identifier) + (integer))) + (expression_statement + (augmented_assignment + (identifier) + (integer))) + (expression_statement + (augmented_assignment + (identifier) + (identifier))) (expression_statement (augmented_assignment (identifier) @@ -1123,3 +1194,26 @@ match(r1, r2, r3) (identifier) (identifier) (identifier))))) + +================================================================================ +Type expressions +================================================================================ + +a: A[T] | B + +-------------------------------------------------------------------------------- + +(module + (expression_statement + (assignment + (identifier) + (type + (union_type + (type + (generic_type + (identifier) + (type_parameter + (type + (identifier))))) + (type + (identifier)))))))