diff --git a/grammar.js b/grammar.js index 10eba7c..7efd0f1 100644 --- a/grammar.js +++ b/grammar.js @@ -310,19 +310,23 @@ module.exports = grammar({ string_literal: ($) => seq( - $._string_start, - repeat(choice($._string_body, $.escape_sequence)), - $._string_end, + field("open", alias($._string_start, '("|""")')), + field("body", repeat(choice($._string_body, $.escape_sequence))), + field("close", alias($._string_end, '("|""")')), ), raw_string_literal: ($) => - seq($._raw_string_start, optional($._string_body), $._raw_string_end), + seq( + field("open", alias($._raw_string_start, "('|''')")), + field("body", optional($._string_body)), + field("close", alias($._raw_string_end, "('|''')")), + ), external_command: ($) => seq( - $._command_start, - repeat(choice(prec(1, $.interpolation), $.command_body)), - $._command_end, + field("open", alias($._command_start, "(`|```)")), + field("body", repeat(choice(prec(1, $.interpolation), $.command_body))), + field("close", alias($._command_end, "(`|```)")), ), command_body: ($) => $._string_body, @@ -330,6 +334,5 @@ module.exports = grammar({ escape_sequence: (_) => ESCAPE_SEQUENCE, text: (_) => /.+/, //recipe TEXT, only matches in a recipe body - // text: (_) => /\S+/, //recipe TEXT, only matches in a recipe body }, }); diff --git a/queries-src/highlights.scm b/queries-src/highlights.scm index 96875bb..75cf322 100644 --- a/queries-src/highlights.scm +++ b/queries-src/highlights.scm @@ -79,11 +79,6 @@ (comment) @comment.line -; (interpolation) @string - -; FIXME: interpreter -; (shebang interpreter:(TEXT) @keyword ) @comment - [ "alias" "export" @@ -92,7 +87,7 @@ "set" ] @keyword -; exclude `=` and `&&` since they are valid in more normal scopes +; exclude `=` and `&&` since they are valid only in specific scopes ; (matching is covered in their parent nodes) ["@" "==" "!=" "+" "*" ":" "/" "?"] @operator @@ -100,6 +95,11 @@ ["," ":"] @punctuation.delimiter -; "`" @punctuation.special + +; open and close are "`" or "```" +(external_command + open: _ @punctuation.special + close: _ @punctuation.special + ) (ERROR) @error diff --git a/queries-src/injections.scm b/queries-src/injections.scm index b8495b7..62d817a 100644 --- a/queries-src/injections.scm +++ b/queries-src/injections.scm @@ -1,15 +1,23 @@ -(comment) @comment +; This query specifies how nested languages are handled -; FIXME: shebang -; (shebang_recipe -; (shebang -; interpreter:(TEXT) @language) -; (shebang_body) @content -; ) +((comment) @injection.content + (#set! injection.language "comment")) -(source_file - ; (item (setting lang:(identifier) @language)) - (item (recipe (recipe_body) @content)) -) -; (interpolation (expression) @just) +(recipe_line + (text) @injection.content + (#set! injection.language "bash")) + +(external_command + (command_body) @injection.content + (#set! injection.language "bash")) + +; ; FIXME: read default from shebang +; ([ +; (recipe_body +; (recipe_line (text))) +; (external_command +; body: (_)*) +; ] @injection.content +; (#set! injection.language "bash") +; ) diff --git a/queries/just/highlights.scm b/queries/just/highlights.scm index 21e68d3..47d3931 100644 --- a/queries/just/highlights.scm +++ b/queries/just/highlights.scm @@ -81,11 +81,6 @@ (comment) @comment -; (interpolation) @string - -; FIXME: interpreter -; (shebang interpreter:(TEXT) @keyword ) @comment - [ "alias" "export" @@ -94,7 +89,7 @@ "set" ] @keyword -; exclude `=` and `&&` since they are valid in more normal scopes +; exclude `=` and `&&` since they are valid only in specific scopes ; (matching is covered in their parent nodes) ["@" "==" "!=" "+" "*" ":" "/" "?"] @operator @@ -102,6 +97,11 @@ ["," ":"] @punctuation.delimiter -; "`" @punctuation.special + +; open and close are "`" or "```" +(external_command + open: _ @punctuation.special + close: _ @punctuation.special + ) (ERROR) @error diff --git a/queries/just/injections.scm b/queries/just/injections.scm index 9747d62..f825648 100644 --- a/queries/just/injections.scm +++ b/queries/just/injections.scm @@ -1,17 +1,25 @@ ; File autogenerated by build-queries-nvim.py; do not edit -(comment) @comment +; This query specifies how nested languages are handled -; FIXME: shebang -; (shebang_recipe -; (shebang -; interpreter:(TEXT) @language) -; (shebang_body) @content -; ) +((comment) @injection.content + (#set! injection.language "comment")) -(source_file - ; (item (setting lang:(identifier) @language)) - (item (recipe (recipe_body) @content)) -) -; (interpolation (expression) @just) +(recipe_line + (text) @injection.content + (#set! injection.language "bash")) + +(external_command + (command_body) @injection.content + (#set! injection.language "bash")) + +; ; FIXME: read default from shebang +; ([ +; (recipe_body +; (recipe_line (text))) +; (external_command +; body: (_)*) +; ] @injection.content +; (#set! injection.language "bash") +; ) diff --git a/src/grammar.json b/src/grammar.json index 517388a..81dbe03 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -1298,28 +1298,50 @@ "type": "SEQ", "members": [ { - "type": "SYMBOL", - "name": "_string_start" + "type": "FIELD", + "name": "open", + "content": { + "type": "ALIAS", + "content": { + "type": "SYMBOL", + "name": "_string_start" + }, + "named": false, + "value": "(\"|\"\"\")" + } }, { - "type": "REPEAT", + "type": "FIELD", + "name": "body", "content": { - "type": "CHOICE", - "members": [ - { - "type": "SYMBOL", - "name": "_string_body" - }, - { - "type": "SYMBOL", - "name": "escape_sequence" - } - ] + "type": "REPEAT", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "_string_body" + }, + { + "type": "SYMBOL", + "name": "escape_sequence" + } + ] + } } }, { - "type": "SYMBOL", - "name": "_string_end" + "type": "FIELD", + "name": "close", + "content": { + "type": "ALIAS", + "content": { + "type": "SYMBOL", + "name": "_string_end" + }, + "named": false, + "value": "(\"|\"\"\")" + } } ] }, @@ -1327,24 +1349,46 @@ "type": "SEQ", "members": [ { - "type": "SYMBOL", - "name": "_raw_string_start" - }, - { - "type": "CHOICE", - "members": [ - { + "type": "FIELD", + "name": "open", + "content": { + "type": "ALIAS", + "content": { "type": "SYMBOL", - "name": "_string_body" + "name": "_raw_string_start" }, - { - "type": "BLANK" - } - ] + "named": false, + "value": "('|''')" + } }, { - "type": "SYMBOL", - "name": "_raw_string_end" + "type": "FIELD", + "name": "body", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "_string_body" + }, + { + "type": "BLANK" + } + ] + } + }, + { + "type": "FIELD", + "name": "close", + "content": { + "type": "ALIAS", + "content": { + "type": "SYMBOL", + "name": "_raw_string_end" + }, + "named": false, + "value": "('|''')" + } } ] }, @@ -1352,32 +1396,54 @@ "type": "SEQ", "members": [ { - "type": "SYMBOL", - "name": "_command_start" + "type": "FIELD", + "name": "open", + "content": { + "type": "ALIAS", + "content": { + "type": "SYMBOL", + "name": "_command_start" + }, + "named": false, + "value": "(`|```)" + } }, { - "type": "REPEAT", + "type": "FIELD", + "name": "body", "content": { - "type": "CHOICE", - "members": [ - { - "type": "PREC", - "value": 1, - "content": { + "type": "REPEAT", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "PREC", + "value": 1, + "content": { + "type": "SYMBOL", + "name": "interpolation" + } + }, + { "type": "SYMBOL", - "name": "interpolation" + "name": "command_body" } - }, - { - "type": "SYMBOL", - "name": "command_body" - } - ] + ] + } } }, { - "type": "SYMBOL", - "name": "_command_end" + "type": "FIELD", + "name": "close", + "content": { + "type": "ALIAS", + "content": { + "type": "SYMBOL", + "name": "_command_end" + }, + "named": false, + "value": "(`|```)" + } } ] }, diff --git a/src/node-types.json b/src/node-types.json index 0b5fdbd..16338bd 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -254,20 +254,41 @@ { "type": "external_command", "named": true, - "fields": {}, - "children": { - "multiple": true, - "required": false, - "types": [ - { - "type": "command_body", - "named": true - }, - { - "type": "interpolation", - "named": true - } - ] + "fields": { + "body": { + "multiple": true, + "required": false, + "types": [ + { + "type": "command_body", + "named": true + }, + { + "type": "interpolation", + "named": true + } + ] + }, + "close": { + "multiple": false, + "required": true, + "types": [ + { + "type": "(`|```)", + "named": false + } + ] + }, + "open": { + "multiple": false, + "required": true, + "types": [ + { + "type": "(`|```)", + "named": false + } + ] + } } }, { @@ -477,7 +498,28 @@ { "type": "raw_string_literal", "named": true, - "fields": {} + "fields": { + "close": { + "multiple": false, + "required": true, + "types": [ + { + "type": "('|''')", + "named": false + } + ] + }, + "open": { + "multiple": false, + "required": true, + "types": [ + { + "type": "('|''')", + "named": false + } + ] + } + } }, { "type": "recipe", @@ -724,16 +766,37 @@ { "type": "string_literal", "named": true, - "fields": {}, - "children": { - "multiple": true, - "required": false, - "types": [ - { - "type": "escape_sequence", - "named": true - } - ] + "fields": { + "body": { + "multiple": true, + "required": false, + "types": [ + { + "type": "escape_sequence", + "named": true + } + ] + }, + "close": { + "multiple": false, + "required": true, + "types": [ + { + "type": "(\"|\"\"\")", + "named": false + } + ] + }, + "open": { + "multiple": false, + "required": true, + "types": [ + { + "type": "(\"|\"\"\")", + "named": false + } + ] + } } }, { @@ -817,6 +880,18 @@ "type": "(", "named": false }, + { + "type": "(\"|\"\"\")", + "named": false + }, + { + "type": "('|''')", + "named": false + }, + { + "type": "(`|```)", + "named": false + }, { "type": ")", "named": false diff --git a/src/parser.c b/src/parser.c index 64d49b7..d684f87 100644 --- a/src/parser.c +++ b/src/parser.c @@ -12,9 +12,9 @@ #define ALIAS_COUNT 1 #define TOKEN_COUNT 51 #define EXTERNAL_TOKEN_COUNT 10 -#define FIELD_COUNT 16 +#define FIELD_COUNT 19 #define MAX_ALIAS_SEQUENCE_LENGTH 9 -#define PRODUCTION_ID_COUNT 46 +#define PRODUCTION_ID_COUNT 48 enum { sym_identifier = 1, @@ -166,13 +166,13 @@ static const char * const ts_symbol_names[] = { [sym__indent] = "_indent", [sym__dedent] = "_dedent", [sym__newline] = "_newline", - [sym__string_start] = "_string_start", - [sym__string_end] = "_string_end", + [sym__string_start] = "(\"|\"\"\")", + [sym__string_end] = "(\"|\"\"\")", [sym__string_body] = "_string_body", - [sym__raw_string_start] = "_raw_string_start", - [sym__raw_string_end] = "_raw_string_end", - [sym__command_start] = "_command_start", - [sym__command_end] = "_command_end", + [sym__raw_string_start] = "('|''')", + [sym__raw_string_end] = "('|''')", + [sym__command_start] = "(`|```)", + [sym__command_end] = "(`|```)", [sym_source_file] = "source_file", [sym_item] = "item", [sym_eol] = "eol", @@ -273,12 +273,12 @@ static const TSSymbol ts_symbol_map[] = { [sym__dedent] = sym__dedent, [sym__newline] = sym__newline, [sym__string_start] = sym__string_start, - [sym__string_end] = sym__string_end, + [sym__string_end] = sym__string_start, [sym__string_body] = sym__string_body, [sym__raw_string_start] = sym__raw_string_start, - [sym__raw_string_end] = sym__raw_string_end, + [sym__raw_string_end] = sym__raw_string_start, [sym__command_start] = sym__command_start, - [sym__command_end] = sym__command_end, + [sym__command_end] = sym__command_start, [sym_source_file] = sym_source_file, [sym_item] = sym_item, [sym_eol] = sym_eol, @@ -511,32 +511,32 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .named = true, }, [sym__string_start] = { - .visible = false, - .named = true, + .visible = true, + .named = false, }, [sym__string_end] = { - .visible = false, - .named = true, + .visible = true, + .named = false, }, [sym__string_body] = { .visible = false, .named = true, }, [sym__raw_string_start] = { - .visible = false, - .named = true, + .visible = true, + .named = false, }, [sym__raw_string_end] = { - .visible = false, - .named = true, + .visible = true, + .named = false, }, [sym__command_start] = { - .visible = false, - .named = true, + .visible = true, + .named = false, }, [sym__command_end] = { - .visible = false, - .named = true, + .visible = true, + .named = false, }, [sym_source_file] = { .visible = true, @@ -753,18 +753,21 @@ enum { field_array = 2, field_array_item = 3, field_attr_item = 4, - field_braced_body = 5, - field_contents = 6, - field_default = 7, - field_expression = 8, - field_kleene = 9, - field_left = 10, - field_mod_name = 11, - field_name = 12, - field_param = 13, - field_recipe = 14, - field_recipe_name = 15, - field_right = 16, + field_body = 5, + field_braced_body = 6, + field_close = 7, + field_contents = 8, + field_default = 9, + field_expression = 10, + field_kleene = 11, + field_left = 12, + field_mod_name = 13, + field_name = 14, + field_open = 15, + field_param = 16, + field_recipe = 17, + field_recipe_name = 18, + field_right = 19, }; static const char * const ts_field_names[] = { @@ -773,7 +776,9 @@ static const char * const ts_field_names[] = { [field_array] = "array", [field_array_item] = "array_item", [field_attr_item] = "attr_item", + [field_body] = "body", [field_braced_body] = "braced_body", + [field_close] = "close", [field_contents] = "contents", [field_default] = "default", [field_expression] = "expression", @@ -781,6 +786,7 @@ static const char * const ts_field_names[] = { [field_left] = "left", [field_mod_name] = "mod_name", [field_name] = "name", + [field_open] = "open", [field_param] = "param", [field_recipe] = "recipe", [field_recipe_name] = "recipe_name", @@ -791,47 +797,49 @@ static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { [1] = {.index = 0, .length = 1}, [2] = {.index = 1, .length = 1}, [3] = {.index = 2, .length = 1}, - [4] = {.index = 3, .length = 1}, - [5] = {.index = 4, .length = 1}, - [6] = {.index = 5, .length = 1}, - [7] = {.index = 6, .length = 1}, - [8] = {.index = 7, .length = 1}, - [9] = {.index = 8, .length = 1}, - [10] = {.index = 9, .length = 2}, - [11] = {.index = 11, .length = 1}, - [12] = {.index = 12, .length = 2}, - [13] = {.index = 14, .length = 2}, - [14] = {.index = 16, .length = 2}, - [15] = {.index = 18, .length = 3}, - [16] = {.index = 21, .length = 3}, - [17] = {.index = 24, .length = 1}, - [18] = {.index = 25, .length = 1}, - [20] = {.index = 26, .length = 1}, - [21] = {.index = 27, .length = 1}, - [22] = {.index = 28, .length = 2}, - [23] = {.index = 30, .length = 1}, - [24] = {.index = 31, .length = 2}, - [25] = {.index = 33, .length = 4}, - [26] = {.index = 37, .length = 2}, - [27] = {.index = 39, .length = 2}, - [28] = {.index = 41, .length = 2}, - [29] = {.index = 43, .length = 2}, - [30] = {.index = 45, .length = 2}, - [31] = {.index = 47, .length = 1}, - [32] = {.index = 48, .length = 3}, - [33] = {.index = 51, .length = 2}, - [34] = {.index = 53, .length = 5}, - [35] = {.index = 58, .length = 1}, - [36] = {.index = 59, .length = 2}, - [37] = {.index = 61, .length = 2}, - [38] = {.index = 63, .length = 4}, - [39] = {.index = 67, .length = 5}, - [40] = {.index = 72, .length = 6}, - [41] = {.index = 78, .length = 7}, - [42] = {.index = 85, .length = 3}, - [43] = {.index = 88, .length = 6}, - [44] = {.index = 94, .length = 8}, - [45] = {.index = 102, .length = 1}, + [4] = {.index = 3, .length = 2}, + [5] = {.index = 5, .length = 1}, + [6] = {.index = 6, .length = 1}, + [7] = {.index = 7, .length = 1}, + [8] = {.index = 8, .length = 1}, + [9] = {.index = 9, .length = 1}, + [10] = {.index = 10, .length = 1}, + [11] = {.index = 11, .length = 2}, + [12] = {.index = 13, .length = 3}, + [13] = {.index = 16, .length = 1}, + [14] = {.index = 17, .length = 2}, + [15] = {.index = 19, .length = 2}, + [16] = {.index = 21, .length = 2}, + [17] = {.index = 23, .length = 3}, + [18] = {.index = 26, .length = 3}, + [19] = {.index = 29, .length = 1}, + [20] = {.index = 30, .length = 1}, + [22] = {.index = 31, .length = 1}, + [23] = {.index = 32, .length = 1}, + [24] = {.index = 33, .length = 2}, + [25] = {.index = 35, .length = 1}, + [26] = {.index = 36, .length = 2}, + [27] = {.index = 38, .length = 4}, + [28] = {.index = 42, .length = 2}, + [29] = {.index = 44, .length = 2}, + [30] = {.index = 46, .length = 2}, + [31] = {.index = 48, .length = 2}, + [32] = {.index = 50, .length = 2}, + [33] = {.index = 52, .length = 1}, + [34] = {.index = 53, .length = 3}, + [35] = {.index = 56, .length = 2}, + [36] = {.index = 58, .length = 5}, + [37] = {.index = 63, .length = 1}, + [38] = {.index = 64, .length = 2}, + [39] = {.index = 66, .length = 2}, + [40] = {.index = 68, .length = 4}, + [41] = {.index = 72, .length = 5}, + [42] = {.index = 77, .length = 6}, + [43] = {.index = 83, .length = 7}, + [44] = {.index = 90, .length = 3}, + [45] = {.index = 93, .length = 6}, + [46] = {.index = 99, .length = 8}, + [47] = {.index = 107, .length = 1}, }; static const TSFieldMapEntry ts_field_map_entries[] = { @@ -842,117 +850,124 @@ static const TSFieldMapEntry ts_field_map_entries[] = { [2] = {field_param, 0}, [3] = + {field_close, 1}, + {field_open, 0}, + [5] = {field_mod_name, 2}, - [4] = + [6] = {field_left, 1}, - [5] = + [7] = {field_recipe_name, 1}, - [6] = + [8] = {field_kleene, 0}, - [7] = + [9] = {field_recipe, 0}, - [8] = + [10] = {field_param, 1}, - [9] = + [11] = {field_left, 1}, {field_right, 3}, - [11] = + [13] = + {field_body, 1}, + {field_close, 2}, + {field_open, 0}, + [16] = {field_attr_item, 1}, - [12] = + [17] = {field_attr_item, 0, .inherited = true}, {field_attr_item, 1, .inherited = true}, - [14] = + [19] = {field_left, 0}, {field_right, 2}, - [16] = + [21] = {field_default, 2}, {field_param, 0}, - [18] = + [23] = {field_left, 1}, {field_right, 2}, {field_right, 3}, - [21] = + [26] = {field_attr_item, 1}, {field_attr_item, 2, .inherited = true}, {field_contents, 2}, - [24] = + [29] = {field_braced_body, 2, .inherited = true}, - [25] = + [30] = {field_name, 0}, - [26] = + [31] = {field_recipe, 1}, - [27] = + [32] = {field_expression, 0}, - [28] = + [33] = {field_default, 3}, {field_param, 1}, - [30] = + [35] = {field_contents, 1}, - [31] = + [36] = {field_right, 3}, {field_right, 4}, - [33] = + [38] = {field_array, 3}, {field_array, 4}, {field_left, 1}, {field_right, 2}, - [37] = + [42] = {field_braced_body, 2, .inherited = true}, {field_braced_body, 3, .inherited = true}, - [39] = + [44] = {field_arguments, 2}, {field_name, 0}, - [41] = + [46] = {field_expression, 2, .inherited = true}, {field_recipe, 1}, - [43] = + [48] = {field_expression, 0, .inherited = true}, {field_expression, 1, .inherited = true}, - [45] = + [50] = {field_contents, 1}, {field_contents, 2}, - [47] = + [52] = {field_array_item, 1}, - [48] = + [53] = {field_array_item, 4}, {field_right, 3}, {field_right, 5}, - [51] = + [56] = {field_array_item, 0, .inherited = true}, {field_array_item, 1, .inherited = true}, - [53] = + [58] = {field_array, 3}, {field_array, 5}, {field_array_item, 4}, {field_left, 1}, {field_right, 2}, - [58] = + [63] = {field_braced_body, 1}, - [59] = + [64] = {field_braced_body, 2, .inherited = true}, {field_braced_body, 4, .inherited = true}, - [61] = + [66] = {field_braced_body, 0, .inherited = true}, {field_braced_body, 1, .inherited = true}, - [63] = + [68] = {field_array_item, 4}, {field_array_item, 5}, {field_right, 3}, {field_right, 6}, - [67] = + [72] = {field_array_item, 4}, {field_array_item, 5, .inherited = true}, {field_contents, 5}, {field_right, 3}, {field_right, 6}, - [72] = + [77] = {field_array, 3}, {field_array, 6}, {field_array_item, 4}, {field_array_item, 5}, {field_left, 1}, {field_right, 2}, - [78] = + [83] = {field_array, 3}, {field_array, 6}, {field_array_item, 4}, @@ -960,18 +975,18 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_contents, 5}, {field_left, 1}, {field_right, 2}, - [85] = + [90] = {field_braced_body, 2, .inherited = true}, {field_braced_body, 3, .inherited = true}, {field_braced_body, 5, .inherited = true}, - [88] = + [93] = {field_array_item, 4}, {field_array_item, 5, .inherited = true}, {field_array_item, 6}, {field_contents, 5}, {field_right, 3}, {field_right, 7}, - [94] = + [99] = {field_array, 3}, {field_array, 7}, {field_array_item, 4}, @@ -980,13 +995,13 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_contents, 5}, {field_left, 1}, {field_right, 2}, - [102] = + [107] = {field_braced_body, 3, .inherited = true}, }; static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = { [0] = {0}, - [19] = { + [21] = { [0] = anon_alias_sym_expression, [2] = anon_alias_sym_expression, }, @@ -6989,14 +7004,14 @@ static const TSParseActionEntry ts_parse_actions[] = { [95] = {.entry = {.count = 1, .reusable = true}}, SHIFT(302), [97] = {.entry = {.count = 1, .reusable = true}}, SHIFT(164), [99] = {.entry = {.count = 1, .reusable = true}}, SHIFT(219), - [101] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_dependency_expression_repeat1, 2, .production_id = 29), SHIFT_REPEAT(123), - [104] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_dependency_expression_repeat1, 2, .production_id = 29), SHIFT_REPEAT(42), - [107] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_dependency_expression_repeat1, 2, .production_id = 29), SHIFT_REPEAT(16), - [110] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_dependency_expression_repeat1, 2, .production_id = 29), SHIFT_REPEAT(33), - [113] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_dependency_expression_repeat1, 2, .production_id = 29), - [115] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_dependency_expression_repeat1, 2, .production_id = 29), SHIFT_REPEAT(226), - [118] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_dependency_expression_repeat1, 2, .production_id = 29), SHIFT_REPEAT(302), - [121] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_dependency_expression_repeat1, 2, .production_id = 29), SHIFT_REPEAT(164), + [101] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_dependency_expression_repeat1, 2, .production_id = 31), SHIFT_REPEAT(123), + [104] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_dependency_expression_repeat1, 2, .production_id = 31), SHIFT_REPEAT(42), + [107] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_dependency_expression_repeat1, 2, .production_id = 31), SHIFT_REPEAT(16), + [110] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_dependency_expression_repeat1, 2, .production_id = 31), SHIFT_REPEAT(33), + [113] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_dependency_expression_repeat1, 2, .production_id = 31), + [115] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_dependency_expression_repeat1, 2, .production_id = 31), SHIFT_REPEAT(226), + [118] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_dependency_expression_repeat1, 2, .production_id = 31), SHIFT_REPEAT(302), + [121] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_dependency_expression_repeat1, 2, .production_id = 31), SHIFT_REPEAT(164), [124] = {.entry = {.count = 1, .reusable = true}}, SHIFT(280), [126] = {.entry = {.count = 1, .reusable = false}}, SHIFT(213), [128] = {.entry = {.count = 1, .reusable = true}}, SHIFT(44), @@ -7005,8 +7020,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [134] = {.entry = {.count = 1, .reusable = true}}, SHIFT(210), [136] = {.entry = {.count = 1, .reusable = true}}, SHIFT(297), [138] = {.entry = {.count = 1, .reusable = true}}, SHIFT(162), - [140] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module, 3, .production_id = 4), - [142] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_module, 3, .production_id = 4), + [140] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module, 3, .production_id = 5), + [142] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_module, 3, .production_id = 5), [144] = {.entry = {.count = 1, .reusable = true}}, SHIFT(234), [146] = {.entry = {.count = 1, .reusable = true}}, SHIFT(288), [148] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module, 2, .production_id = 1), @@ -7022,121 +7037,121 @@ static const TSParseActionEntry ts_parse_actions[] = { [168] = {.entry = {.count = 1, .reusable = false}}, SHIFT(194), [170] = {.entry = {.count = 1, .reusable = true}}, SHIFT(101), [172] = {.entry = {.count = 1, .reusable = true}}, SHIFT(146), - [174] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string_literal, 3), + [174] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string_literal, 3, .production_id = 12), [176] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_value, 1), [178] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), - [180] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_raw_string_literal, 2), - [182] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string_literal, 2), - [184] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_raw_string_literal, 3), - [186] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_external_command, 2), - [188] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_string_literal, 2), + [180] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_raw_string_literal, 2, .production_id = 4), + [182] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string_literal, 2, .production_id = 4), + [184] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_raw_string_literal, 3, .production_id = 12), + [186] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_external_command, 2, .production_id = 4), + [188] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_string_literal, 2, .production_id = 4), [190] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_recipe_body_repeat1, 2), SHIFT_REPEAT(256), [193] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_recipe_body_repeat1, 2), SHIFT_REPEAT(31), [196] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_recipe_body_repeat1, 2), SHIFT_REPEAT(194), [199] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_recipe_body_repeat1, 2), [201] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_recipe_body_repeat1, 2), SHIFT_REPEAT(146), - [204] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_raw_string_literal, 3), + [204] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_raw_string_literal, 3, .production_id = 12), [206] = {.entry = {.count = 1, .reusable = true}}, SHIFT(93), [208] = {.entry = {.count = 1, .reusable = true}}, SHIFT(69), - [210] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_raw_string_literal, 2), - [212] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_call, 4, .production_id = 27), + [210] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_raw_string_literal, 2, .production_id = 4), + [212] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_call, 4, .production_id = 29), [214] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_recipe, 2), [216] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_recipe, 2), [218] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), [220] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_recipe, 3), [222] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_recipe, 3), - [224] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_string_literal, 3), - [226] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_external_command, 3), + [224] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_string_literal, 3, .production_id = 12), + [226] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_external_command, 3, .production_id = 12), [228] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_value, 3), - [230] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_call, 3, .production_id = 18), - [232] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_recipe_body, 4, .production_id = 30), - [234] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_recipe_body, 4, .production_id = 30), - [236] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 5, .production_id = 15), - [238] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 5, .production_id = 15), - [240] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 8, .production_id = 38), - [242] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 8, .production_id = 38), - [244] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_expression, 4, .production_id = 26), + [230] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_call, 3, .production_id = 20), + [232] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_recipe_body, 4, .production_id = 32), + [234] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_recipe_body, 4, .production_id = 32), + [236] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 5, .production_id = 17), + [238] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 5, .production_id = 17), + [240] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 8, .production_id = 40), + [242] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 8, .production_id = 40), + [244] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_expression, 4, .production_id = 28), [246] = {.entry = {.count = 1, .reusable = true}}, SHIFT(262), - [248] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 3, .production_id = 5), - [250] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 3, .production_id = 5), - [252] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_if_expression_repeat1, 2, .production_id = 37), - [254] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_if_expression_repeat1, 2, .production_id = 37), - [256] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_if_expression_repeat1, 2, .production_id = 37), SHIFT_REPEAT(357), + [248] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 3, .production_id = 6), + [250] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 3, .production_id = 6), + [252] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_if_expression_repeat1, 2, .production_id = 39), + [254] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_if_expression_repeat1, 2, .production_id = 39), + [256] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_if_expression_repeat1, 2, .production_id = 39), SHIFT_REPEAT(357), [259] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_item, 1), [261] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_item, 1), - [263] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 8, .production_id = 39), - [265] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 8, .production_id = 39), + [263] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 8, .production_id = 41), + [265] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 8, .production_id = 41), [267] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_eol, 1), [269] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_eol, 1), - [271] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 8, .production_id = 40), - [273] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 8, .production_id = 40), - [275] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 8, .production_id = 41), - [277] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 8, .production_id = 41), - [279] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 9, .production_id = 43), - [281] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 9, .production_id = 43), - [283] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 7, .production_id = 34), - [285] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 7, .production_id = 34), - [287] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 9, .production_id = 44), - [289] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 9, .production_id = 44), - [291] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if_expression, 4, .production_id = 26), + [271] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 8, .production_id = 42), + [273] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 8, .production_id = 42), + [275] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 8, .production_id = 43), + [277] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 8, .production_id = 43), + [279] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 9, .production_id = 45), + [281] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 9, .production_id = 45), + [283] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 7, .production_id = 36), + [285] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 7, .production_id = 36), + [287] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 9, .production_id = 46), + [289] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 9, .production_id = 46), + [291] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if_expression, 4, .production_id = 28), [293] = {.entry = {.count = 1, .reusable = false}}, SHIFT(255), [295] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_export, 2), [297] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_export, 2), - [299] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 7, .production_id = 32), - [301] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 7, .production_id = 32), - [303] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_if_expression_repeat1, 2, .production_id = 37), SHIFT_REPEAT(352), - [306] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assignment, 4, .production_id = 13), - [308] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assignment, 4, .production_id = 13), + [299] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 7, .production_id = 34), + [301] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 7, .production_id = 34), + [303] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_if_expression_repeat1, 2, .production_id = 39), SHIFT_REPEAT(352), + [306] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_assignment, 4, .production_id = 15), + [308] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_assignment, 4, .production_id = 15), [310] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module, 3, .production_id = 1), [312] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_module, 3, .production_id = 1), [314] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_import, 3), [316] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_import, 3), - [318] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 6, .production_id = 25), - [320] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 6, .production_id = 25), + [318] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 6, .production_id = 27), + [320] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 6, .production_id = 27), [322] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_import, 2), [324] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_import, 2), [326] = {.entry = {.count = 1, .reusable = true}}, SHIFT(38), - [328] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_recipe_body, 3, .production_id = 23), - [330] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_recipe_body, 3, .production_id = 23), + [328] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_recipe_body, 3, .production_id = 25), + [330] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_recipe_body, 3, .production_id = 25), [332] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comment, 2), [334] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_comment, 2), [336] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_shebang, 2), [338] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_shebang, 2), [340] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_recipe, 4), [342] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_recipe, 4), - [344] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_alias, 4, .production_id = 10), - [346] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_alias, 4, .production_id = 10), - [348] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if_expression, 3, .production_id = 17), - [350] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_expression, 3, .production_id = 17), + [344] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_alias, 4, .production_id = 11), + [346] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_alias, 4, .production_id = 11), + [348] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if_expression, 3, .production_id = 19), + [350] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_expression, 3, .production_id = 19), [352] = {.entry = {.count = 1, .reusable = false}}, SHIFT(252), - [354] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module, 4, .production_id = 4), - [356] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_module, 4, .production_id = 4), + [354] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_module, 4, .production_id = 5), + [356] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_module, 4, .production_id = 5), [358] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_recipe_body, 2), [360] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_recipe_body, 2), - [362] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 6, .production_id = 24), - [364] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 6, .production_id = 24), + [362] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_setting, 6, .production_id = 26), + [364] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_setting, 6, .production_id = 26), [366] = {.entry = {.count = 1, .reusable = true}}, SHIFT(250), - [368] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_if_expression_repeat1, 4, .production_id = 45), - [370] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_if_expression_repeat1, 4, .production_id = 45), - [372] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__braced_expr, 3, .production_id = 35), + [368] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_if_expression_repeat1, 4, .production_id = 47), + [370] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_if_expression_repeat1, 4, .production_id = 47), + [372] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__braced_expr, 3, .production_id = 37), [374] = {.entry = {.count = 1, .reusable = true}}, SHIFT(172), [376] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), [378] = {.entry = {.count = 1, .reusable = true}}, SHIFT(260), [380] = {.entry = {.count = 1, .reusable = false}}, SHIFT(173), [382] = {.entry = {.count = 1, .reusable = true}}, SHIFT(308), - [384] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__braced_expr, 3, .production_id = 35), - [386] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_external_command, 3), + [384] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__braced_expr, 3, .production_id = 37), + [386] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_external_command, 3, .production_id = 12), [388] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_value, 3), - [390] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_call, 4, .production_id = 27), + [390] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_call, 4, .production_id = 29), [392] = {.entry = {.count = 1, .reusable = true}}, SHIFT(173), - [394] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if_expression, 5, .production_id = 36), - [396] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_expression, 5, .production_id = 36), - [398] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__expression_inner, 3, .production_id = 19), - [400] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__expression_inner, 3, .production_id = 19), + [394] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if_expression, 5, .production_id = 38), + [396] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_expression, 5, .production_id = 38), + [398] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__expression_inner, 3, .production_id = 21), + [400] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__expression_inner, 3, .production_id = 21), [402] = {.entry = {.count = 1, .reusable = true}}, SHIFT(50), - [404] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_call, 3, .production_id = 18), - [406] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if_expression, 6, .production_id = 42), - [408] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_expression, 6, .production_id = 42), + [404] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_function_call, 3, .production_id = 20), + [406] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_if_expression, 6, .production_id = 44), + [408] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_if_expression, 6, .production_id = 44), [410] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_value, 1), [412] = {.entry = {.count = 1, .reusable = true}}, SHIFT(159), [414] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 1), @@ -7147,7 +7162,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [424] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_expression, 2), [426] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 2), [428] = {.entry = {.count = 1, .reusable = true}}, SHIFT(49), - [430] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_external_command, 2), + [430] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_external_command, 2, .production_id = 4), [432] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__expression_inner, 1), [434] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__expression_inner, 1), [436] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_expression, 1), @@ -7165,8 +7180,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [460] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_recipe_line, 3), [462] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_recipe_line, 1), [464] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_recipe_line, 1), - [466] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_dependency_expression_repeat1, 1, .production_id = 21), - [468] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_dependency_expression_repeat1, 1, .production_id = 21), + [466] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_dependency_expression_repeat1, 1, .production_id = 23), + [468] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_dependency_expression_repeat1, 1, .production_id = 23), [470] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_dependencies_repeat1, 2), SHIFT_REPEAT(231), [473] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_dependencies_repeat1, 2), SHIFT_REPEAT(334), [476] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_dependencies_repeat1, 2), SHIFT_REPEAT(183), @@ -7185,7 +7200,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [504] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_external_command_repeat1, 2), SHIFT_REPEAT(263), [507] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_external_command_repeat1, 2), [509] = {.entry = {.count = 1, .reusable = true}}, SHIFT(178), - [511] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_recipe_header, 3, .production_id = 6), + [511] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_recipe_header, 3, .production_id = 7), [513] = {.entry = {.count = 1, .reusable = true}}, SHIFT(278), [515] = {.entry = {.count = 1, .reusable = true}}, SHIFT(216), [517] = {.entry = {.count = 1, .reusable = true}}, SHIFT(275), @@ -7193,13 +7208,13 @@ static const TSParseActionEntry ts_parse_actions[] = { [521] = {.entry = {.count = 1, .reusable = true}}, SHIFT(133), [523] = {.entry = {.count = 1, .reusable = true}}, SHIFT(53), [525] = {.entry = {.count = 1, .reusable = true}}, SHIFT(247), - [527] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_recipe_header, 4, .production_id = 6), + [527] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_recipe_header, 4, .production_id = 7), [529] = {.entry = {.count = 1, .reusable = true}}, SHIFT(230), - [531] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_if_expression_repeat1, 2, .production_id = 37), SHIFT_REPEAT(348), + [531] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_if_expression_repeat1, 2, .production_id = 39), SHIFT_REPEAT(348), [534] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_parameters_repeat1, 2), SHIFT_REPEAT(172), [537] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_parameters_repeat1, 2), [539] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_parameters_repeat1, 2), SHIFT_REPEAT(308), - [542] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parameter, 2, .production_id = 9), + [542] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parameter, 2, .production_id = 10), [544] = {.entry = {.count = 1, .reusable = true}}, SHIFT(103), [546] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parameter, 1, .production_id = 3), [548] = {.entry = {.count = 1, .reusable = true}}, SHIFT(92), @@ -7212,12 +7227,12 @@ static const TSParseActionEntry ts_parse_actions[] = { [563] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parameters, 2), [565] = {.entry = {.count = 1, .reusable = true}}, SHIFT(268), [567] = {.entry = {.count = 1, .reusable = true}}, SHIFT(282), - [569] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_if_expression_repeat1, 2, .production_id = 37), SHIFT_REPEAT(362), + [569] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_if_expression_repeat1, 2, .production_id = 39), SHIFT_REPEAT(362), [572] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parameters, 1), - [574] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parameter, 4, .production_id = 22), - [576] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parameter, 3, .production_id = 14), - [578] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_setting_repeat1, 2, .production_id = 33), SHIFT_REPEAT(189), - [581] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_setting_repeat1, 2, .production_id = 33), + [574] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parameter, 4, .production_id = 24), + [576] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_parameter, 3, .production_id = 16), + [578] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_setting_repeat1, 2, .production_id = 35), SHIFT_REPEAT(189), + [581] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_setting_repeat1, 2, .production_id = 35), [583] = {.entry = {.count = 1, .reusable = true}}, SHIFT(130), [585] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), [587] = {.entry = {.count = 1, .reusable = false}}, SHIFT(195), @@ -7239,8 +7254,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [622] = {.entry = {.count = 1, .reusable = true}}, SHIFT(207), [624] = {.entry = {.count = 1, .reusable = true}}, SHIFT(274), [626] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), - [628] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_setting_repeat1, 2, .production_id = 31), - [630] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_dependency_expression, 4, .production_id = 28), + [628] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_setting_repeat1, 2, .production_id = 33), + [630] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_dependency_expression, 4, .production_id = 30), [632] = {.entry = {.count = 1, .reusable = true}}, SHIFT(52), [634] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), [636] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_condition, 1), @@ -7251,20 +7266,20 @@ static const TSParseActionEntry ts_parse_actions[] = { [646] = {.entry = {.count = 1, .reusable = true}}, SHIFT(225), [648] = {.entry = {.count = 1, .reusable = true}}, SHIFT(119), [650] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), - [652] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_dependency, 1, .production_id = 8), + [652] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_dependency, 1, .production_id = 9), [654] = {.entry = {.count = 1, .reusable = true}}, SHIFT(235), [656] = {.entry = {.count = 1, .reusable = true}}, SHIFT(54), [658] = {.entry = {.count = 1, .reusable = true}}, SHIFT(65), [660] = {.entry = {.count = 1, .reusable = true}}, SHIFT(246), - [662] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_dependency_expression, 3, .production_id = 20), - [664] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute, 4, .production_id = 11), + [662] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_dependency_expression, 3, .production_id = 22), + [664] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute, 4, .production_id = 13), [666] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), [668] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), [670] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_interpolation, 3), [672] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_interpolation, 3), [674] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), [676] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30), - [678] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute, 5, .production_id = 16), + [678] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute, 5, .production_id = 18), [680] = {.entry = {.count = 1, .reusable = true}}, SHIFT(359), [682] = {.entry = {.count = 1, .reusable = true}}, SHIFT(203), [684] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_recipe_line_prefix, 1), @@ -7274,8 +7289,8 @@ static const TSParseActionEntry ts_parse_actions[] = { [692] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29), [694] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sequence, 2), [696] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_command_body, 1), - [698] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_attribute_repeat1, 2, .production_id = 12), SHIFT_REPEAT(359), - [701] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_attribute_repeat1, 2, .production_id = 12), + [698] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_attribute_repeat1, 2, .production_id = 14), SHIFT_REPEAT(359), + [701] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_attribute_repeat1, 2, .production_id = 14), [703] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sequence, 1), [705] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), [707] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), @@ -7290,7 +7305,7 @@ static const TSParseActionEntry ts_parse_actions[] = { [726] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), [728] = {.entry = {.count = 1, .reusable = true}}, SHIFT(329), [730] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_boolean, 1), - [732] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_attribute_repeat1, 2, .production_id = 11), + [732] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_attribute_repeat1, 2, .production_id = 13), [734] = {.entry = {.count = 1, .reusable = false}}, SHIFT(188), [736] = {.entry = {.count = 1, .reusable = false}}, SHIFT(316), [738] = {.entry = {.count = 1, .reusable = true}}, SHIFT(346), @@ -7301,13 +7316,13 @@ static const TSParseActionEntry ts_parse_actions[] = { [748] = {.entry = {.count = 1, .reusable = true}}, SHIFT(121), [750] = {.entry = {.count = 1, .reusable = true}}, SHIFT(318), [752] = {.entry = {.count = 1, .reusable = true}}, SHIFT(243), - [754] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_variadic_parameter, 2, .production_id = 7), + [754] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_variadic_parameter, 2, .production_id = 8), [756] = {.entry = {.count = 1, .reusable = true}}, SHIFT(171), [758] = {.entry = {.count = 1, .reusable = true}}, SHIFT(67), [760] = {.entry = {.count = 1, .reusable = true}}, SHIFT(251), [762] = {.entry = {.count = 1, .reusable = true}}, SHIFT(60), [764] = {.entry = {.count = 1, .reusable = true}}, SHIFT(107), - [766] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_recipe_header, 5, .production_id = 6), + [766] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_recipe_header, 5, .production_id = 7), [768] = {.entry = {.count = 1, .reusable = true}}, SHIFT(257), [770] = {.entry = {.count = 1, .reusable = true}}, SHIFT(325), [772] = {.entry = {.count = 1, .reusable = true}}, SHIFT(220), diff --git a/test/corpus/injections.txt b/test/corpus/injections.txt index 2baa57e..18391b9 100644 --- a/test/corpus/injections.txt +++ b/test/corpus/injections.txt @@ -1,3 +1,21 @@ +================================================================================ +global shebang +================================================================================ + +#!/usr/bin/env just + +-------------------------------------------------------------------------------- + +(source_file + (item + (eol)) + (item + (eol + (comment))) + (item + (eol))) + + ================================================================================ backtick injections ================================================================================ diff --git a/test/highlight/injections.just b/test/highlight/injections.just new file mode 100644 index 0000000..06768d4 --- /dev/null +++ b/test/highlight/injections.just @@ -0,0 +1,28 @@ +# Injection highlighting shows up as none during tests +localhost := `if [ -f "foo" ]; then; echo hi; fi` +# <- variable +# ^^ operator +# ^ punctuation.special +# ^ punctuation.special + +# interpolation within injection +foo := `[ {{ dir(localhost) }} = "hi" ] && "bye"` +# <- variable +# ^^ operator +# ^ punctuation.special +# ^^ punctuation.bracket +# ^^^ function +# ^ punctuation.bracket +# ^^^^^^^^^ variable +# ^ punctuation.bracket +# ^^ punctuation.bracket +# ^ punctuation.special + +stuff := ``` + echo foo + echo bar +``` +# <- punctuation.special + +foo: + echo "hello {{ foo }}"