@xyd-js/mcp-server 0.0.0-build-7c0274d-20251004231821 → 0.0.0-build-ae5d7ac-20251012020134
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -2
- package/dist/index.js +27 -27
- package/package.json +6 -2
- package/src/mcp.ts +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# @xyd-js/mcp-server
|
|
2
2
|
|
|
3
|
-
## 0.0.0-build-
|
|
3
|
+
## 0.0.0-build-ae5d7ac-20251012020134
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- update all packages
|
|
8
8
|
- Updated dependencies
|
|
9
|
-
- @xyd-js/mcp@0.0.0-build-
|
|
9
|
+
- @xyd-js/mcp@0.0.0-build-ae5d7ac-20251012020134
|
package/dist/index.js
CHANGED
|
@@ -61147,7 +61147,7 @@ var i113 = "source.shell";
|
|
|
61147
61147
|
var l18;
|
|
61148
61148
|
var init_shellscript = __esm2(() => {
|
|
61149
61149
|
t161 = [{ include: "#initial_context" }];
|
|
61150
|
-
a160 = { alias_statement: { begin: "(?:(?:[ \\t]*+)(alias)(?:[ \\t]*+)((?:(?:((?<!\\w)-\\w+\\b)(?:[ \\t]*+))*))(?:(?:[ \\t]*+)(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:(?:(\\[)((?:(?:(?:(?:\\$?)(?:(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))|@)|\\*)|(-?\\d+)))(\\]))?))(?:(?:(\\=)|(\\+\\=))|(\\-\\=))))", beginCaptures: { 1: { name: "storage.type.alias.shell" }, 2: { patterns: [{ match: "(?<!\\w)-\\w+\\b", name: "string.unquoted.argument.shell constant.other.option.shell" }] }, 3: { name: "string.unquoted.argument.shell constant.other.option.shell" }, 4: { name: "variable.other.assignment.shell" }, 5: { name: "punctuation.definition.array.access.shell" }, 6: { name: "variable.other.assignment.shell" }, 7: { name: "constant.numeric.shell constant.numeric.integer.shell" }, 8: { name: "punctuation.definition.array.access.shell" }, 9: { name: "keyword.operator.assignment.shell" }, 10: { name: "keyword.operator.assignment.compound.shell" }, 11: { name: "keyword.operator.assignment.compound.shell" } }, end: "(?:(?= |\\t|$)|(?:(?:(?:(;)|(&&))|(\\|\\|))|(&)))", endCaptures: { 1: { name: "punctuation.terminator.statement.semicolon.shell" }, 2: { name: "punctuation.separator.statement.and.shell" }, 3: { name: "punctuation.separator.statement.or.shell" }, 4: { name: "punctuation.separator.statement.background.shell" } }, name: "meta.expression.assignment.alias.shell", patterns: [{ include: "#normal_context" }] }, argument: { begin: "(?:[ \\t]++)(?!(?:&|\\||\\(|\\[|#|\\n|$|;))", beginCaptures: {}, end: "(?= |\\t|;|\\||&|$|\\n|\\)|\\`)", endCaptures: {}, name: "meta.argument.shell", patterns: [{ include: "#argument_context" }, { include: "#line_continuation" }] }, argument_context: { patterns: [{ captures: { 1: { name: "string.unquoted.argument.shell", patterns: [{ match: "\\*", name: "variable.language.special.wildcard.shell" }, { include: "#variable" }, { include: "#numeric_literal" }, { captures: { 1: { name: "constant.language.$1.shell" } }, match: "(?<!\\w)(\\b(?:true|false)\\b)(?!\\w)" }] } }, match: "(?:[ \\t]*+)((?:[^ \\t\\n>&;<>\\(\\)\\$`\\\\\"'<\\|]+)(?!>))" }, { include: "#normal_context" }] }, arithmetic_double: { patterns: [{ begin: "\\(\\(", beginCaptures: { 0: { name: "punctuation.section.arithmetic.double.shell" } }, end: "\\)(?:\\s*)\\)", endCaptures: { 0: { name: "punctuation.section.arithmetic.double.shell" } }, name: "meta.arithmetic.shell", patterns: [{ include: "#math" }, { include: "#string" }] }] }, arithmetic_no_dollar: { patterns: [{ begin: "\\(", beginCaptures: { 0: { name: "punctuation.section.arithmetic.single.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.section.arithmetic.single.shell" } }, name: "meta.arithmetic.shell", patterns: [{ include: "#math" }, { include: "#string" }] }] }, array_access_inline: { captures: { 1: { name: "punctuation.section.array.shell" }, 2: { patterns: [{ include: "#special_expansion" }, { include: "#string" }, { include: "#variable" }] }, 3: { name: "punctuation.section.array.shell" } }, match: "(?:(\\[)([^\\[\\]]+)(\\]))" }, array_value: { begin: "(?:[ \\t]*+)(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:(?:(\\[)((?:(?:(?:(?:\\$?)(?:(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))|@)|\\*)|(-?\\d+)))(\\]))?))(?:(?:(\\=)|(\\+\\=))|(\\-\\=))(?:[ \\t]*+)(\\()", beginCaptures: { 1: { name: "variable.other.assignment.shell" }, 2: { name: "punctuation.definition.array.access.shell" }, 3: { name: "variable.other.assignment.shell" }, 4: { name: "constant.numeric.shell constant.numeric.integer.shell" }, 5: { name: "punctuation.definition.array.access.shell" }, 6: { name: "keyword.operator.assignment.shell" }, 7: { name: "keyword.operator.assignment.compound.shell" }, 8: { name: "keyword.operator.assignment.compound.shell" }, 9: { name: "punctuation.definition.array.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.array.shell" } }, patterns: [{ include: "#comment" }, { captures: { 1: { name: "variable.other.assignment.array.shell entity.other.attribute-name.shell" }, 2: { name: "keyword.operator.assignment.shell punctuation.definition.assignment.shell" } }, match: "(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(\\=))" }, { captures: { 1: { name: "punctuation.definition.bracket.named-array.shell" }, 2: { name: "string.unquoted.shell entity.other.attribute-name.bracket.shell" }, 3: { name: "punctuation.definition.bracket.named-array.shell" }, 4: { name: "punctuation.definition.assignment.shell" } }, match: "(?:(\\[)(.+?)(\\])(\\=))" }, { include: "#normal_context" }, { include: "#simple_unquoted" }] }, assignment_statement: { patterns: [{ include: "#array_value" }, { include: "#modified_assignment_statement" }, { include: "#normal_assignment_statement" }] }, basic_command_name: { captures: { 1: { name: "storage.modifier.$1.shell" }, 2: { name: "entity.name.function.call.shell entity.name.command.shell", patterns: [{ match: "(?<!\\w)(?:continue|return|break)(?!\\w)", name: "keyword.control.$0.shell" }, { match: "(?<!\\w)(?:(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|:|\\.)(?!\\/))(?!\\w)(?!-)", name: "support.function.builtin.shell" }, { include: "#variable" }] } }, match: `(?:(?:(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!nocorrect |nocorrect |nocorrect$|readonly |readonly |readonly$|function |function |function$|foreach |foreach |foreach$|coproc |coproc |coproc$|logout |logout |logout$|export |export |export$|select |select |select$|repeat |repeat |repeat$|pushd |pushd |pushd$|until |until |until$|while |while |while$|local |local |local$|case |case |case$|done |done |done$|elif |elif |elif$|else |else |else$|esac |esac |esac$|popd |popd |popd$|then |then |then$|time |time |time$|for |for |for$|end |end |end$|fi |fi |fi$|do |do |do$|in |in |in$|if |if |if$))(?:((?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$))|((?!"|'|\\\\\\n?$)(?:[^!'"<> \\t\\n\\r]+?)))(?:(?= |\\t)|(?:(?=;|\\||&|\\n|\\)|\\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\))))`, name: "meta.statement.command.name.basic.shell" }, block_comment: { begin: "(?:(?:\\s*+)(\\/\\*))", beginCaptures: { 1: { name: "punctuation.definition.comment.begin.shell" } }, end: "\\*\\/", endCaptures: { 0: { name: "punctuation.definition.comment.end.shell" } }, name: "comment.block.shell" }, boolean: { match: "\\b(?:true|false)\\b", name: "constant.language.$0.shell" }, case_statement: { begin: "(?:(\\bcase\\b)(?:[ \\t]*+)(.+?)(?:[ \\t]*+)(\\bin\\b))", beginCaptures: { 1: { name: "keyword.control.case.shell" }, 2: { patterns: [{ include: "#initial_context" }] }, 3: { name: "keyword.control.in.shell" } }, end: "\\besac\\b", endCaptures: { 0: { name: "keyword.control.esac.shell" } }, name: "meta.case.shell", patterns: [{ include: "#comment" }, { captures: { 1: { name: "keyword.operator.pattern.case.default.shell" } }, match: "(?:[ \\t]*+)(\\* *\\))" }, { begin: "(?<!\\))(?!(?:[ \\t]*+)(?:esac\\b|$))", beginCaptures: {}, end: "(?:(?=\\besac\\b)|(\\)))", endCaptures: { 1: { name: "keyword.operator.pattern.case.shell" } }, name: "meta.case.entry.pattern.shell", patterns: [{ include: "#case_statement_context" }] }, { begin: "(?<=\\))", beginCaptures: {}, end: "(?:(;;)|(?=\\besac\\b))", endCaptures: { 1: { name: "punctuation.terminator.statement.case.shell" } }, name: "meta.case.entry.body.shell", patterns: [{ include: "#typical_statements" }, { include: "#initial_context" }] }] }, case_statement_context: { patterns: [{ match: "\\*", name: "variable.language.special.quantifier.star.shell keyword.operator.quantifier.star.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell" }, { match: "\\+", name: "variable.language.special.quantifier.plus.shell keyword.operator.quantifier.plus.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell" }, { match: "\\?", name: "variable.language.special.quantifier.question.shell keyword.operator.quantifier.question.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell" }, { match: "@", name: "variable.language.special.at.shell keyword.operator.at.shell punctuation.definition.regex.at.shell" }, { match: "\\|", name: "keyword.operator.orvariable.language.special.or.shell keyword.operator.alternation.ruby.shell punctuation.definition.regex.alternation.shell punctuation.separator.regex.alternation.shell" }, { match: "\\\\.", name: "constant.character.escape.shell" }, { match: "(?<=\\tin| in| |\\t|;;)\\(", name: "keyword.operator.pattern.case.shell" }, { begin: "(?<=\\S)(\\()", beginCaptures: { 1: { name: "punctuation.definition.group.shell punctuation.definition.regex.group.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.group.shell punctuation.definition.regex.group.shell" } }, name: "meta.parenthese.shell", patterns: [{ include: "#case_statement_context" }] }, { begin: "\\[", beginCaptures: { 0: { name: "punctuation.definition.character-class.shell" } }, end: "\\]", endCaptures: { 0: { name: "punctuation.definition.character-class.shell" } }, name: "string.regexp.character-class.shell", patterns: [{ match: "\\\\.", name: "constant.character.escape.shell" }] }, { include: "#string" }, { match: "[^) \\t\\n\\[\\?\\*\\|\\@]", name: "string.unquoted.pattern.shell string.regexp.unquoted.shell" }] }, command_name_range: { begin: "\\G", beginCaptures: {}, end: "(?:(?= |\\t|;|\\||&|$|\\n|\\)|\\`)|(?=<))", endCaptures: {}, name: "meta.statement.command.name.shell", patterns: [{ match: "(?<!\\w)(?:continue|return|break)(?!\\w)", name: "entity.name.function.call.shell entity.name.command.shell keyword.control.$0.shell" }, { match: "(?<!\\w)(?:(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|:|\\.)(?!\\/))(?!\\w)(?!-)", name: "entity.name.function.call.shell entity.name.command.shell support.function.builtin.shell" }, { include: "#variable" }, { captures: { 1: { name: "entity.name.function.call.shell entity.name.command.shell" } }, match: `(?:(?<!\\w)(?<=\\G|'|"|\\}|\\))([^ \\n\\t\\r"'=;&\\|\`\\)\\{<>]+))` }, { begin: `(?:(?:\\G|(?<! |\\t|;|\\||&|\\n|\\{|#))(?:(\\$?)((?:(")|(')))))`, beginCaptures: { 1: { name: "meta.statement.command.name.quoted.shell punctuation.definition.string.shell entity.name.function.call.shell entity.name.command.shell" }, 2: {}, 3: { name: "meta.statement.command.name.quoted.shell string.quoted.double.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell" }, 4: { name: "meta.statement.command.name.quoted.shell string.quoted.single.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell" } }, end: "(?<!\\G)(?<=(?:\\2))", endCaptures: {}, patterns: [{ include: "#continuation_of_single_quoted_command_name" }, { include: "#continuation_of_double_quoted_command_name" }] }, { include: "#line_continuation" }, { include: "#simple_unquoted" }] }, command_statement: { begin: "(?:(?:[ \\t]*+)(?:(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!nocorrect |nocorrect\t|nocorrect$|readonly |readonly\t|readonly$|function |function\t|function$|foreach |foreach\t|foreach$|coproc |coproc\t|coproc$|logout |logout\t|logout$|export |export\t|export$|select |select\t|select$|repeat |repeat\t|repeat$|pushd |pushd\t|pushd$|until |until\t|until$|while |while\t|while$|local |local\t|local$|case |case\t|case$|done |done\t|done$|elif |elif\t|elif$|else |else\t|else$|esac |esac\t|esac$|popd |popd\t|popd$|then |then\t|then$|time |time\t|time$|for |for\t|for$|end |end\t|end$|fi |fi\t|fi$|do |do\t|do$|in |in\t|in$|if |if |if$)(?!\\\\\\n?$)))", beginCaptures: {}, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.statement.command.shell", patterns: [{ include: "#command_name_range" }, { include: "#line_continuation" }, { include: "#option" }, { include: "#argument" }, { include: "#string" }, { include: "#heredoc" }] }, comment: { captures: { 1: { name: "comment.line.number-sign.shell meta.shebang.shell" }, 2: { name: "punctuation.definition.comment.shebang.shell" }, 3: { name: "comment.line.number-sign.shell" }, 4: { name: "punctuation.definition.comment.shell" } }, match: "(?:(?:^|(?:[ \\t]++))(?:((?:(#!)(?:.*)))|((?:(#)(?:.*)))))" }, comments: { patterns: [{ include: "#block_comment" }, { include: "#line_comment" }] }, "compound-command": { patterns: [{ begin: "\\[", beginCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, end: "\\]", endCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, name: "meta.scope.logical-expression.shell", patterns: [{ include: "#logical-expression" }, { include: "#initial_context" }] }, { begin: "(?<=\\s|^){(?=\\s|$)", beginCaptures: { 0: { name: "punctuation.definition.group.shell" } }, end: "(?<=^|;)\\s*(})", endCaptures: { 1: { name: "punctuation.definition.group.shell" } }, name: "meta.scope.group.shell", patterns: [{ include: "#initial_context" }] }] }, continuation_of_double_quoted_command_name: { begin: '(?:\\G(?<="))', beginCaptures: {}, contentName: "meta.statement.command.name.continuation string.quoted.double entity.name.function.call entity.name.command", end: '"', endCaptures: { 0: { name: "string.quoted.double.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell" } }, patterns: [{ match: '\\\\[\\$\\n`"\\\\]', name: "constant.character.escape.shell" }, { include: "#variable" }, { include: "#interpolation" }] }, continuation_of_single_quoted_command_name: { begin: "(?:\\G(?<='))", beginCaptures: {}, contentName: "meta.statement.command.name.continuation string.quoted.single entity.name.function.call entity.name.command", end: "'", endCaptures: { 0: { name: "string.quoted.single.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell" } } }, custom_command_names: { patterns: [] }, custom_commands: { patterns: [] }, double_quote_context: { patterns: [{ match: '\\\\[\\$`"\\\\\\n]', name: "constant.character.escape.shell" }, { include: "#variable" }, { include: "#interpolation" }] }, double_quote_escape_char: { match: '\\\\[\\$`"\\\\\\n]', name: "constant.character.escape.shell" }, floating_keyword: { patterns: [{ match: "(?<=^|;|&| |\\t)(?:then|elif|else|done|end|do|if|fi)(?= |\\t|;|&|$)", name: "keyword.control.$0.shell" }] }, for_statement: { patterns: [{ begin: "(?:(\\bfor\\b)(?:(?:[ \\t]*+)((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:[ \\t]*+)(\\bin\\b)))", beginCaptures: { 1: { name: "keyword.control.for.shell" }, 2: { name: "variable.other.for.shell" }, 3: { name: "keyword.control.in.shell" } }, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.for.in.shell", patterns: [{ include: "#string" }, { include: "#simple_unquoted" }, { include: "#normal_context" }] }, { begin: "(\\bfor\\b)", beginCaptures: { 1: { name: "keyword.control.for.shell" } }, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.for.shell", patterns: [{ include: "#arithmetic_double" }, { include: "#normal_context" }] }] }, function_definition: { applyEndPatternLast: 1, begin: `(?:[ \\t]*+)(?:(?:(\\bfunction\\b)(?:[ \\t]*+)([^ \\t\\n\\r\\(\\)="']+)(?:(?:(\\()(?:[ \\t]*+)(\\)))?))|(?:([^ \\t\\n\\r\\(\\)="']+)(?:[ \\t]*+)(\\()(?:[ \\t]*+)(\\))))`, beginCaptures: { 1: { name: "storage.type.function.shell" }, 2: { name: "entity.name.function.shell" }, 3: { name: "punctuation.definition.arguments.shell" }, 4: { name: "punctuation.definition.arguments.shell" }, 5: { name: "entity.name.function.shell" }, 6: { name: "punctuation.definition.arguments.shell" }, 7: { name: "punctuation.definition.arguments.shell" } }, end: "(?<=\\}|\\))", endCaptures: {}, name: "meta.function.shell", patterns: [{ match: "(?:\\G(?:\\t| |\\n))" }, { begin: "\\{", beginCaptures: { 0: { name: "punctuation.definition.group.shell punctuation.section.function.definition.shell" } }, end: "\\}", endCaptures: { 0: { name: "punctuation.definition.group.shell punctuation.section.function.definition.shell" } }, name: "meta.function.body.shell", patterns: [{ include: "#initial_context" }] }, { begin: "\\(", beginCaptures: { 0: { name: "punctuation.definition.group.shell punctuation.section.function.definition.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.group.shell punctuation.section.function.definition.shell" } }, name: "meta.function.body.shell", patterns: [{ include: "#initial_context" }] }, { include: "#initial_context" }] }, heredoc: { patterns: [{ begin: `(?:((?<!<)(?:<<-))(?:[ \\t]*+)("|')(?:[ \\t]*+)([^"']+?)(?=\\s|;|&|<|"|')((?:\\2))(.*))`, beginCaptures: { 1: { name: "keyword.operator.heredoc.shell" }, 2: { name: "punctuation.definition.string.heredoc.quote.shell" }, 3: { name: "punctuation.definition.string.heredoc.delimiter.shell" }, 4: { name: "punctuation.definition.string.heredoc.quote.shell" }, 5: { patterns: [{ include: "#redirect_fix" }, { include: "#typical_statements" }] } }, contentName: "string.quoted.heredoc.indent.$3", end: "(?:(?:^\\t*)(?:\\3)(?=\\s|;|&|$))", endCaptures: { 0: { name: "punctuation.definition.string.heredoc.$0.shell" } }, patterns: [] }, { begin: `(?:((?<!<)(?:<<)(?!<))(?:[ \\t]*+)("|')(?:[ \\t]*+)([^"']+?)(?=\\s|;|&|<|"|')((?:\\2))(.*))`, beginCaptures: { 1: { name: "keyword.operator.heredoc.shell" }, 2: { name: "punctuation.definition.string.heredoc.quote.shell" }, 3: { name: "punctuation.definition.string.heredoc.delimiter.shell" }, 4: { name: "punctuation.definition.string.heredoc.quote.shell" }, 5: { patterns: [{ include: "#redirect_fix" }, { include: "#typical_statements" }] } }, contentName: "string.quoted.heredoc.no-indent.$3", end: "(?:^(?:\\3)(?=\\s|;|&|$))", endCaptures: { 0: { name: "punctuation.definition.string.heredoc.delimiter.shell" } }, patterns: [] }, { begin: `(?:((?<!<)(?:<<-))(?:[ \\t]*+)([^"' \\t]+)(?=\\s|;|&|<|"|')(.*))`, beginCaptures: { 1: { name: "keyword.operator.heredoc.shell" }, 2: { name: "punctuation.definition.string.heredoc.delimiter.shell" }, 3: { patterns: [{ include: "#redirect_fix" }, { include: "#typical_statements" }] } }, contentName: "string.unquoted.heredoc.indent.$2", end: "(?:(?:^\\t*)(?:\\2)(?=\\s|;|&|$))", endCaptures: { 0: { name: "punctuation.definition.string.heredoc.delimiter.shell" } }, patterns: [{ include: "#double_quote_escape_char" }, { include: "#variable" }, { include: "#interpolation" }] }, { begin: `(?:((?<!<)(?:<<)(?!<))(?:[ \\t]*+)([^"' \\t]+)(?=\\s|;|&|<|"|')(.*))`, beginCaptures: { 1: { name: "keyword.operator.heredoc.shell" }, 2: { name: "punctuation.definition.string.heredoc.delimiter.shell" }, 3: { patterns: [{ include: "#redirect_fix" }, { include: "#typical_statements" }] } }, contentName: "string.unquoted.heredoc.no-indent.$2", end: "(?:^(?:\\2)(?=\\s|;|&|$))", endCaptures: { 0: { name: "punctuation.definition.string.heredoc.delimiter.shell" } }, patterns: [{ include: "#double_quote_escape_char" }, { include: "#variable" }, { include: "#interpolation" }] }] }, herestring: { patterns: [{ begin: "(<<<)\\s*(('))", beginCaptures: { 1: { name: "keyword.operator.herestring.shell" }, 2: { name: "string.quoted.single.shell" }, 3: { name: "punctuation.definition.string.begin.shell" } }, contentName: "string.quoted.single.shell", end: "(')", endCaptures: { 0: { name: "string.quoted.single.shell" }, 1: { name: "punctuation.definition.string.end.shell" } }, name: "meta.herestring.shell" }, { begin: '(<<<)\\s*(("))', beginCaptures: { 1: { name: "keyword.operator.herestring.shell" }, 2: { name: "string.quoted.double.shell" }, 3: { name: "punctuation.definition.string.begin.shell" } }, contentName: "string.quoted.double.shell", end: '(")', endCaptures: { 0: { name: "string.quoted.double.shell" }, 1: { name: "punctuation.definition.string.end.shell" } }, name: "meta.herestring.shell", patterns: [{ include: "#double_quote_context" }] }, { captures: { 1: { name: "keyword.operator.herestring.shell" }, 2: { name: "string.unquoted.herestring.shell", patterns: [{ include: "#initial_context" }] } }, match: "(<<<)\\s*(([^\\s)\\\\]|\\\\.)+)", name: "meta.herestring.shell" }] }, initial_context: { patterns: [{ include: "#comment" }, { include: "#pipeline" }, { include: "#normal_statement_seperator" }, { include: "#logical_expression_double" }, { include: "#logical_expression_single" }, { include: "#assignment_statement" }, { include: "#case_statement" }, { include: "#for_statement" }, { include: "#loop" }, { include: "#function_definition" }, { include: "#line_continuation" }, { include: "#arithmetic_double" }, { include: "#misc_ranges" }, { include: "#variable" }, { include: "#interpolation" }, { include: "#heredoc" }, { include: "#herestring" }, { include: "#redirection" }, { include: "#pathname" }, { include: "#floating_keyword" }, { include: "#alias_statement" }, { include: "#normal_statement" }, { include: "#string" }, { include: "#support" }] }, inline_comment: { captures: { 1: { name: "comment.block.shell punctuation.definition.comment.begin.shell" }, 2: { name: "comment.block.shell" }, 3: { patterns: [{ match: "\\*\\/", name: "comment.block.shell punctuation.definition.comment.end.shell" }, { match: "\\*", name: "comment.block.shell" }] } }, match: "(\\/\\*)((?:(?:[^\\*]|(?:(?:\\*++)[^\\/]))*+)((?:(?:\\*++)\\/)))" }, interpolation: { patterns: [{ include: "#arithmetic_dollar" }, { include: "#subshell_dollar" }, { begin: "`", beginCaptures: { 0: { name: "punctuation.definition.evaluation.backticks.shell" } }, end: "`", endCaptures: { 0: { name: "punctuation.definition.evaluation.backticks.shell" } }, name: "string.interpolated.backtick.shell", patterns: [{ match: "\\\\[`\\\\$]", name: "constant.character.escape.shell" }, { begin: "(?<=\\W)(?=#)(?!#{)", beginCaptures: { 1: { name: "punctuation.whitespace.comment.leading.shell" } }, end: "(?!\\G)", patterns: [{ begin: "#", beginCaptures: { 0: { name: "punctuation.definition.comment.shell" } }, end: "(?=`)", name: "comment.line.number-sign.shell" }] }, { include: "#initial_context" }] }] }, keyword: { patterns: [{ match: "(?<=^|;|&|\\s)(then|else|elif|fi|for|in|do|done|select|continue|esac|while|until|return)(?=\\s|;|&|$)", name: "keyword.control.shell" }, { match: "(?<=^|;|&|\\s)(?:export|declare|typeset|local|readonly)(?=\\s|;|&|$)", name: "storage.modifier.shell" }] }, line_comment: { begin: "(?:\\s*+)(\\/\\/)", beginCaptures: { 1: { name: "punctuation.definition.comment.shell" } }, end: "(?<=\\n)(?<!\\\\\\n)", endCaptures: {}, name: "comment.line.double-slash.shell", patterns: [{ include: "#line_continuation_character" }] }, line_continuation: { match: "\\\\(?=\\n)", name: "constant.character.escape.line-continuation.shell" }, "logical-expression": { patterns: [{ include: "#arithmetic_no_dollar" }, { comment: "do we want a special rule for ( expr )?", match: "=[=~]?|!=?|<|>|&&|\\|\\|", name: "keyword.operator.logical.shell" }, { match: "(?<!\\S)-(nt|ot|ef|eq|ne|l[te]|g[te]|[a-hknoprstuwxzOGLSN])\\b", name: "keyword.operator.logical.shell" }] }, logical_expression_context: { patterns: [{ include: "#regex_comparison" }, { include: "#arithmetic_no_dollar" }, { include: "#logical-expression" }, { include: "#logical_expression_single" }, { include: "#logical_expression_double" }, { include: "#comment" }, { include: "#boolean" }, { include: "#redirect_number" }, { include: "#numeric_literal" }, { include: "#pipeline" }, { include: "#normal_statement_seperator" }, { include: "#string" }, { include: "#variable" }, { include: "#interpolation" }, { include: "#heredoc" }, { include: "#herestring" }, { include: "#pathname" }, { include: "#floating_keyword" }, { include: "#support" }] }, logical_expression_double: { begin: "\\[\\[", beginCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, end: "\\]\\]", endCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, name: "meta.scope.logical-expression.shell", patterns: [{ include: "#logical_expression_context" }] }, logical_expression_single: { begin: "\\[", beginCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, end: "\\]", endCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, name: "meta.scope.logical-expression.shell", patterns: [{ include: "#logical_expression_context" }] }, loop: { patterns: [{ begin: "(?<=^|;|&|\\s)(for)\\s+(.+?)\\s+(in)(?=\\s|;|&|$)", beginCaptures: { 1: { name: "keyword.control.shell" }, 2: { name: "variable.other.loop.shell", patterns: [{ include: "#string" }] }, 3: { name: "keyword.control.shell" } }, end: "(?<=^|;|&|\\s)done(?=\\s|;|&|$|\\))", endCaptures: { 0: { name: "keyword.control.shell" } }, name: "meta.scope.for-in-loop.shell", patterns: [{ include: "#initial_context" }] }, { begin: "(?<=^|;|&|\\s)(while|until)(?=\\s|;|&|$)", beginCaptures: { 1: { name: "keyword.control.shell" } }, end: "(?<=^|;|&|\\s)done(?=\\s|;|&|$|\\))", endCaptures: { 0: { name: "keyword.control.shell" } }, name: "meta.scope.while-loop.shell", patterns: [{ include: "#initial_context" }] }, { begin: "(?<=^|;|&|\\s)(select)\\s+((?:[^\\s\\\\]|\\\\.)+)(?=\\s|;|&|$)", beginCaptures: { 1: { name: "keyword.control.shell" }, 2: { name: "variable.other.loop.shell" } }, end: "(?<=^|;|&|\\s)(done)(?=\\s|;|&|$|\\))", endCaptures: { 1: { name: "keyword.control.shell" } }, name: "meta.scope.select-block.shell", patterns: [{ include: "#initial_context" }] }, { begin: "(?<=^|;|&|\\s)if(?=\\s|;|&|$)", beginCaptures: { 0: { name: "keyword.control.if.shell" } }, end: "(?<=^|;|&|\\s)fi(?=\\s|;|&|$)", endCaptures: { 0: { name: "keyword.control.fi.shell" } }, name: "meta.scope.if-block.shell", patterns: [{ include: "#initial_context" }] }] }, math: { patterns: [{ include: "#variable" }, { match: "\\+{1,2}|-{1,2}|!|~|\\*{1,2}|/|%|<[<=]?|>[>=]?|==|!=|^|\\|{1,2}|&{1,2}|\\?|\\:|,|=|[*/%+\\-&^|]=|<<=|>>=", name: "keyword.operator.arithmetic.shell" }, { match: "0[xX][0-9A-Fa-f]+", name: "constant.numeric.hex.shell" }, { match: ";", name: "punctuation.separator.semicolon.range" }, { match: "0\\d+", name: "constant.numeric.octal.shell" }, { match: "\\d{1,2}#[0-9a-zA-Z@_]+", name: "constant.numeric.other.shell" }, { match: "\\d+", name: "constant.numeric.integer.shell" }, { match: "(?<!\\w)(?:[a-zA-Z_0-9]+)(?!\\w)", name: "variable.other.normal.shell" }] }, math_operators: { patterns: [{ match: "\\+{1,2}|-{1,2}|!|~|\\*{1,2}|/|%|<[<=]?|>[>=]?|==|!=|^|\\|{1,2}|&{1,2}|\\?|\\:|,|=|[*/%+\\-&^|]=|<<=|>>=", name: "keyword.operator.arithmetic.shell" }, { match: "0[xX][0-9A-Fa-f]+", name: "constant.numeric.hex.shell" }, { match: "0\\d+", name: "constant.numeric.octal.shell" }, { match: "\\d{1,2}#[0-9a-zA-Z@_]+", name: "constant.numeric.other.shell" }, { match: "\\d+", name: "constant.numeric.integer.shell" }] }, misc_ranges: { patterns: [{ include: "#logical_expression_single" }, { include: "#logical_expression_double" }, { include: "#subshell_dollar" }, { begin: "(?<![^ \\t])({)(?!\\w|\\$)", beginCaptures: { 1: { name: "punctuation.definition.group.shell" } }, end: "}", endCaptures: { 0: { name: "punctuation.definition.group.shell" } }, name: "meta.scope.group.shell", patterns: [{ include: "#initial_context" }] }] }, modified_assignment_statement: { begin: "(?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$)", beginCaptures: { 0: { name: "storage.modifier.$0.shell" } }, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.statement.shell meta.expression.assignment.modified.shell", patterns: [{ match: "(?<!\\w)-\\w+\\b", name: "string.unquoted.argument.shell constant.other.option.shell" }, { include: "#array_value" }, { captures: { 1: { name: "variable.other.assignment.shell" }, 2: { name: "punctuation.definition.array.access.shell" }, 3: { name: "variable.other.assignment.shell" }, 4: { name: "constant.numeric.shell constant.numeric.integer.shell" }, 5: { name: "punctuation.definition.array.access.shell" }, 6: { name: "keyword.operator.assignment.shell" }, 7: { name: "keyword.operator.assignment.compound.shell" }, 8: { name: "keyword.operator.assignment.compound.shell" }, 9: { name: "constant.numeric.shell constant.numeric.hex.shell" }, 10: { name: "constant.numeric.shell constant.numeric.octal.shell" }, 11: { name: "constant.numeric.shell constant.numeric.other.shell" }, 12: { name: "constant.numeric.shell constant.numeric.decimal.shell" }, 13: { name: "constant.numeric.shell constant.numeric.version.shell" }, 14: { name: "constant.numeric.shell constant.numeric.integer.shell" } }, match: "(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:(?:(\\[)((?:(?:(?:(?:\\$?)(?:(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))|@)|\\*)|(-?\\d+)))(\\]))?)(?:(?:(?:(\\=)|(\\+\\=))|(\\-\\=))?)(?:(?:(?<==| |\\t|^|\\{|\\(|\\[)(?:(?:(?:(?:(?:(0[xX][0-9A-Fa-f]+)|(0\\d+))|(\\d{1,2}#[0-9a-zA-Z@_]+))|(-?\\d+(?:\\.\\d+)))|(-?\\d+(?:\\.\\d+)+))|(-?\\d+))(?= |\\t|$|\\}|\\)|;))?))" }, { include: "#normal_context" }] }, modifiers: { match: "(?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$)", name: "storage.modifier.$0.shell" }, normal_assignment_statement: { begin: "(?:[ \\t]*+)(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:(?:(\\[)((?:(?:(?:(?:\\$?)(?:(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))|@)|\\*)|(-?\\d+)))(\\]))?))(?:(?:(\\=)|(\\+\\=))|(\\-\\=))", beginCaptures: { 1: { name: "variable.other.assignment.shell" }, 2: { name: "punctuation.definition.array.access.shell" }, 3: { name: "variable.other.assignment.shell" }, 4: { name: "constant.numeric.shell constant.numeric.integer.shell" }, 5: { name: "punctuation.definition.array.access.shell" }, 6: { name: "keyword.operator.assignment.shell" }, 7: { name: "keyword.operator.assignment.compound.shell" }, 8: { name: "keyword.operator.assignment.compound.shell" } }, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.expression.assignment.shell", patterns: [{ include: "#comment" }, { include: "#string" }, { include: "#normal_assignment_statement" }, { begin: "(?<= |\\t)(?! |\\t|\\w+=)", beginCaptures: {}, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.statement.command.env.shell", patterns: [{ include: "#command_name_range" }, { include: "#line_continuation" }, { include: "#option" }, { include: "#argument" }, { include: "#string" }] }, { include: "#simple_unquoted" }, { include: "#normal_context" }] }, normal_context: { patterns: [{ include: "#comment" }, { include: "#pipeline" }, { include: "#normal_statement_seperator" }, { include: "#misc_ranges" }, { include: "#boolean" }, { include: "#redirect_number" }, { include: "#numeric_literal" }, { include: "#string" }, { include: "#variable" }, { include: "#interpolation" }, { include: "#heredoc" }, { include: "#herestring" }, { include: "#redirection" }, { include: "#pathname" }, { include: "#floating_keyword" }, { include: "#support" }, { include: "#parenthese" }] }, normal_statement: { begin: "(?:(?!^[ \\t]*+$)(?:(?<=^until | until |\\tuntil |^while | while |\\twhile |^elif | elif |\\telif |^else | else |\\telse |^then | then |\\tthen |^do | do |\\tdo |^if | if |\\tif )|(?<=(?:^|;|\\||&|!|\\(|\\{|\\`)))(?:[ \\t]*+)(?!nocorrect\\W|nocorrect\\$|function\\W|function\\$|foreach\\W|foreach\\$|repeat\\W|repeat\\$|logout\\W|logout\\$|coproc\\W|coproc\\$|select\\W|select\\$|while\\W|while\\$|pushd\\W|pushd\\$|until\\W|until\\$|case\\W|case\\$|done\\W|done\\$|elif\\W|elif\\$|else\\W|else\\$|esac\\W|esac\\$|popd\\W|popd\\$|then\\W|then\\$|time\\W|time\\$|for\\W|for\\$|end\\W|end\\$|fi\\W|fi\\$|do\\W|do\\$|in\\W|in\\$|if\\W|if\\$))", beginCaptures: {}, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.statement.shell", patterns: [{ include: "#typical_statements" }] }, normal_statement_seperator: { captures: { 1: { name: "punctuation.terminator.statement.semicolon.shell" }, 2: { name: "punctuation.separator.statement.and.shell" }, 3: { name: "punctuation.separator.statement.or.shell" }, 4: { name: "punctuation.separator.statement.background.shell" } }, match: "(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))" }, numeric_literal: { captures: { 1: { name: "constant.numeric.shell constant.numeric.hex.shell" }, 2: { name: "constant.numeric.shell constant.numeric.octal.shell" }, 3: { name: "constant.numeric.shell constant.numeric.other.shell" }, 4: { name: "constant.numeric.shell constant.numeric.decimal.shell" }, 5: { name: "constant.numeric.shell constant.numeric.version.shell" }, 6: { name: "constant.numeric.shell constant.numeric.integer.shell" } }, match: "(?<==| |\\t|^|\\{|\\(|\\[)(?:(?:(?:(?:(?:(0[xX][0-9A-Fa-f]+)|(0\\d+))|(\\d{1,2}#[0-9a-zA-Z@_]+))|(-?\\d+(?:\\.\\d+)))|(-?\\d+(?:\\.\\d+)+))|(-?\\d+))(?= |\\t|$|\\}|\\)|;)" }, option: { begin: "(?:(?:[ \\t]++)(-)((?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))))", beginCaptures: { 1: { name: "string.unquoted.argument.shell constant.other.option.dash.shell" }, 2: { name: "string.unquoted.argument.shell constant.other.option.shell" } }, contentName: "string.unquoted.argument constant.other.option", end: "(?:(?=[ \\t])|(?:(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)))", endCaptures: {}, patterns: [{ include: "#option_context" }] }, option_context: { patterns: [{ include: "#misc_ranges" }, { include: "#string" }, { include: "#variable" }, { include: "#interpolation" }, { include: "#heredoc" }, { include: "#herestring" }, { include: "#redirection" }, { include: "#pathname" }, { include: "#floating_keyword" }, { include: "#support" }] }, parenthese: { patterns: [{ begin: "\\(", beginCaptures: { 0: { name: "punctuation.section.parenthese.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.section.parenthese.shell" } }, name: "meta.parenthese.group.shell", patterns: [{ include: "#initial_context" }] }] }, pathname: { patterns: [{ match: "(?<=\\s|:|=|^)~", name: "keyword.operator.tilde.shell" }, { match: "\\*|\\?", name: "keyword.operator.glob.shell" }, { begin: "([?*+@!])(\\()", beginCaptures: { 1: { name: "keyword.operator.extglob.shell" }, 2: { name: "punctuation.definition.extglob.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.extglob.shell" } }, name: "meta.structure.extglob.shell", patterns: [{ include: "#initial_context" }] }] }, pipeline: { patterns: [{ match: "(?<=^|;|&|\\s)(time)(?=\\s|;|&|$)", name: "keyword.other.shell" }, { match: "[|!]", name: "keyword.operator.pipe.shell" }] }, redirect_fix: { captures: { 1: { name: "keyword.operator.redirect.shell" }, 2: { name: "string.unquoted.argument.shell" } }, match: "(?:(>>?)(?:[ \\t]*+)([^ \\t\\n>&;<>\\(\\)\\$`\\\\\"'<\\|]+))" }, redirect_number: { captures: { 1: { name: "keyword.operator.redirect.stdout.shell" }, 2: { name: "keyword.operator.redirect.stderr.shell" }, 3: { name: "keyword.operator.redirect.$3.shell" } }, match: "(?<=[ \\t])(?:(?:(1)|(2)|(\\d+))(?=>))" }, redirection: { patterns: [{ begin: "[><]\\(", beginCaptures: { 0: { name: "punctuation.definition.string.begin.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.string.end.shell" } }, name: "string.interpolated.process-substitution.shell", patterns: [{ include: "#initial_context" }] }, { match: "(?<![<>])(&>|\\d*>&\\d*|\\d*(>>|>|<)|\\d*<&|\\d*<>)(?![<>])", name: "keyword.operator.redirect.shell" }] }, regex_comparison: { match: "\\=~", name: "keyword.operator.logical.regex.shell" }, regexp: { patterns: [{ match: "(?:.+)" }] }, simple_options: { captures: { 0: { patterns: [{ captures: { 1: { name: "string.unquoted.argument.shell constant.other.option.dash.shell" }, 2: { name: "string.unquoted.argument.shell constant.other.option.shell" } }, match: "(?:[ \\t]++)(\\-)(\\w+)" }] } }, match: "(?:(?:[ \\t]++)\\-(?:\\w+))*" }, simple_unquoted: { match: "[^ \\t\\n>&;<>\\(\\)\\$`\\\\\"'<\\|]", name: "string.unquoted.shell" }, special_expansion: { match: "!|:[-=?]?|\\*|@|##|#|%%|%|\\/", name: "keyword.operator.expansion.shell" }, start_of_command: { match: "(?:(?:[ \\t]*+)(?:(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!nocorrect |nocorrect\t|nocorrect$|readonly |readonly\t|readonly$|function |function\t|function$|foreach |foreach\t|foreach$|coproc |coproc\t|coproc$|logout |logout\t|logout$|export |export\t|export$|select |select\t|select$|repeat |repeat\t|repeat$|pushd |pushd\t|pushd$|until |until\t|until$|while |while\t|while$|local |local\t|local$|case |case\t|case$|done |done\t|done$|elif |elif\t|elif$|else |else\t|else$|esac |esac\t|esac$|popd |popd\t|popd$|then |then\t|then$|time |time\t|time$|for |for\t|for$|end |end\t|end$|fi |fi\t|fi$|do |do\t|do$|in |in\t|in$|if |if |if$)(?!\\\\\\n?$)))" }, string: { patterns: [{ match: "\\\\.", name: "constant.character.escape.shell" }, { begin: "'", beginCaptures: { 0: { name: "punctuation.definition.string.begin.shell" } }, end: "'", endCaptures: { 0: { name: "punctuation.definition.string.end.shell" } }, name: "string.quoted.single.shell" }, { begin: '\\$?"', beginCaptures: { 0: { name: "punctuation.definition.string.begin.shell" } }, end: '"', endCaptures: { 0: { name: "punctuation.definition.string.end.shell" } }, name: "string.quoted.double.shell", patterns: [{ match: '\\\\[\\$\\n`"\\\\]', name: "constant.character.escape.shell" }, { include: "#variable" }, { include: "#interpolation" }] }, { begin: "\\$'", beginCaptures: { 0: { name: "punctuation.definition.string.begin.shell" } }, end: "'", endCaptures: { 0: { name: "punctuation.definition.string.end.shell" } }, name: "string.quoted.single.dollar.shell", patterns: [{ match: "\\\\(?:a|b|e|f|n|r|t|v|\\\\|')", name: "constant.character.escape.ansi-c.shell" }, { match: '\\\\[0-9]{3}"', name: "constant.character.escape.octal.shell" }, { match: '\\\\x[0-9a-fA-F]{2}"', name: "constant.character.escape.hex.shell" }, { match: '\\\\c."', name: "constant.character.escape.control-char.shell" }] }] }, subshell_dollar: { patterns: [{ begin: "(?:\\$\\()", beginCaptures: { 0: { name: "punctuation.definition.subshell.single.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.subshell.single.shell" } }, name: "meta.scope.subshell", patterns: [{ include: "#parenthese" }, { include: "#initial_context" }] }] }, support: { patterns: [{ match: "(?<=^|;|&|\\s)(?::|\\.)(?=\\s|;|&|$)", name: "support.function.builtin.shell" }] }, typical_statements: { patterns: [{ include: "#assignment_statement" }, { include: "#case_statement" }, { include: "#for_statement" }, { include: "#while_statement" }, { include: "#function_definition" }, { include: "#command_statement" }, { include: "#line_continuation" }, { include: "#arithmetic_double" }, { include: "#normal_context" }] }, variable: { patterns: [{ captures: { 1: { name: "punctuation.definition.variable.shell variable.parameter.positional.all.shell" }, 2: { name: "variable.parameter.positional.all.shell" } }, match: "(?:(\\$)(\\@(?!\\w)))" }, { captures: { 1: { name: "punctuation.definition.variable.shell variable.parameter.positional.shell" }, 2: { name: "variable.parameter.positional.shell" } }, match: "(?:(\\$)([0-9](?!\\w)))" }, { captures: { 1: { name: "punctuation.definition.variable.shell variable.language.special.shell" }, 2: { name: "variable.language.special.shell" } }, match: "(?:(\\$)([-*#?$!0_](?!\\w)))" }, { begin: "(?:(\\$)(\\{)(?:[ \\t]*+)(?=\\d))", beginCaptures: { 1: { name: "punctuation.definition.variable.shell variable.parameter.positional.shell" }, 2: { name: "punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell variable.parameter.positional.shell" } }, contentName: "meta.parameter-expansion", end: "\\}", endCaptures: { 0: { name: "punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell variable.parameter.positional.shell" } }, patterns: [{ include: "#special_expansion" }, { include: "#array_access_inline" }, { match: "[0-9]+", name: "variable.parameter.positional.shell" }, { match: "(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w)", name: "variable.other.normal.shell" }, { include: "#variable" }, { include: "#string" }] }, { begin: "(?:(\\$)(\\{))", beginCaptures: { 1: { name: "punctuation.definition.variable.shell" }, 2: { name: "punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell" } }, contentName: "meta.parameter-expansion", end: "\\}", endCaptures: { 0: { name: "punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell" } }, patterns: [{ include: "#special_expansion" }, { include: "#array_access_inline" }, { match: "(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w)", name: "variable.other.normal.shell" }, { include: "#variable" }, { include: "#string" }] }, { captures: { 1: { name: "punctuation.definition.variable.shell variable.other.normal.shell" }, 2: { name: "variable.other.normal.shell" } }, match: "(?:(\\$)((?:\\w+)(?!\\w)))" }] }, while_statement: { patterns: [{ begin: "(\\bwhile\\b)", beginCaptures: { 1: { name: "keyword.control.while.shell" } }, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.while.shell", patterns: [{ include: "#line_continuation" }, { include: "#math_operators" }, { include: "#option" }, { include: "#simple_unquoted" }, { include: "#normal_context" }, { include: "#string" }] }] } };
|
|
61150
|
+
a160 = { alias_statement: { begin: "(?:(?:[ \\t]*+)(alias)(?:[ \\t]*+)((?:(?:((?<!\\w)-\\w+\\b)(?:[ \\t]*+))*))(?:(?:[ \\t]*+)(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:(?:(\\[)((?:(?:(?:(?:\\$?)(?:(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))|@)|\\*)|(-?\\d+)))(\\]))?))(?:(?:(\\=)|(\\+\\=))|(\\-\\=))))", beginCaptures: { 1: { name: "storage.type.alias.shell" }, 2: { patterns: [{ match: "(?<!\\w)-\\w+\\b", name: "string.unquoted.argument.shell constant.other.option.shell" }] }, 3: { name: "string.unquoted.argument.shell constant.other.option.shell" }, 4: { name: "variable.other.assignment.shell" }, 5: { name: "punctuation.definition.array.access.shell" }, 6: { name: "variable.other.assignment.shell" }, 7: { name: "constant.numeric.shell constant.numeric.integer.shell" }, 8: { name: "punctuation.definition.array.access.shell" }, 9: { name: "keyword.operator.assignment.shell" }, 10: { name: "keyword.operator.assignment.compound.shell" }, 11: { name: "keyword.operator.assignment.compound.shell" } }, end: "(?:(?= |\\t|$)|(?:(?:(?:(;)|(&&))|(\\|\\|))|(&)))", endCaptures: { 1: { name: "punctuation.terminator.statement.semicolon.shell" }, 2: { name: "punctuation.separator.statement.and.shell" }, 3: { name: "punctuation.separator.statement.or.shell" }, 4: { name: "punctuation.separator.statement.background.shell" } }, name: "meta.expression.assignment.alias.shell", patterns: [{ include: "#normal_context" }] }, argument: { begin: "(?:[ \\t]++)(?!(?:&|\\||\\(|\\[|#|\\n|$|;))", beginCaptures: {}, end: "(?= |\\t|;|\\||&|$|\\n|\\)|\\`)", endCaptures: {}, name: "meta.argument.shell", patterns: [{ include: "#argument_context" }, { include: "#line_continuation" }] }, argument_context: { patterns: [{ captures: { 1: { name: "string.unquoted.argument.shell", patterns: [{ match: "\\*", name: "variable.language.special.wildcard.shell" }, { include: "#variable" }, { include: "#numeric_literal" }, { captures: { 1: { name: "constant.language.$1.shell" } }, match: "(?<!\\w)(\\b(?:true|false)\\b)(?!\\w)" }] } }, match: "(?:[ \\t]*+)((?:[^ \\t\\n>&;<>\\(\\)\\$`\\\\\"'<\\|]+)(?!>))" }, { include: "#normal_context" }] }, arithmetic_double: { patterns: [{ begin: "\\(\\(", beginCaptures: { 0: { name: "punctuation.section.arithmetic.double.shell" } }, end: "\\)(?:\\s*)\\)", endCaptures: { 0: { name: "punctuation.section.arithmetic.double.shell" } }, name: "meta.arithmetic.shell", patterns: [{ include: "#math" }, { include: "#string" }] }] }, arithmetic_no_dollar: { patterns: [{ begin: "\\(", beginCaptures: { 0: { name: "punctuation.section.arithmetic.single.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.section.arithmetic.single.shell" } }, name: "meta.arithmetic.shell", patterns: [{ include: "#math" }, { include: "#string" }] }] }, array_access_inline: { captures: { 1: { name: "punctuation.section.array.shell" }, 2: { patterns: [{ include: "#special_expansion" }, { include: "#string" }, { include: "#variable" }] }, 3: { name: "punctuation.section.array.shell" } }, match: "(?:(\\[)([^\\[\\]]+)(\\]))" }, array_value: { begin: "(?:[ \\t]*+)(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:(?:(\\[)((?:(?:(?:(?:\\$?)(?:(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))|@)|\\*)|(-?\\d+)))(\\]))?))(?:(?:(\\=)|(\\+\\=))|(\\-\\=))(?:[ \\t]*+)(\\()", beginCaptures: { 1: { name: "variable.other.assignment.shell" }, 2: { name: "punctuation.definition.array.access.shell" }, 3: { name: "variable.other.assignment.shell" }, 4: { name: "constant.numeric.shell constant.numeric.integer.shell" }, 5: { name: "punctuation.definition.array.access.shell" }, 6: { name: "keyword.operator.assignment.shell" }, 7: { name: "keyword.operator.assignment.compound.shell" }, 8: { name: "keyword.operator.assignment.compound.shell" }, 9: { name: "punctuation.definition.array.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.array.shell" } }, patterns: [{ include: "#comment" }, { captures: { 1: { name: "variable.other.assignment.array.shell entity.other.attribute-name.shell" }, 2: { name: "keyword.operator.assignment.shell punctuation.definition.assignment.shell" } }, match: "(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(\\=))" }, { captures: { 1: { name: "punctuation.definition.bracket.named-array.shell" }, 2: { name: "string.unquoted.shell entity.other.attribute-name.bracket.shell" }, 3: { name: "punctuation.definition.bracket.named-array.shell" }, 4: { name: "punctuation.definition.assignment.shell" } }, match: "(?:(\\[)(.+?)(\\])(\\=))" }, { include: "#normal_context" }, { include: "#simple_unquoted" }] }, assignment_statement: { patterns: [{ include: "#array_value" }, { include: "#modified_assignment_statement" }, { include: "#normal_assignment_statement" }] }, basic_command_name: { captures: { 1: { name: "storage.modifier.$1.shell" }, 2: { name: "entity.name.function.call.shell entity.name.command.shell", patterns: [{ match: "(?<!\\w)(?:continue|return|break)(?!\\w)", name: "keyword.control.$0.shell" }, { match: "(?<!\\w)(?:(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|:|\\.)(?!\\/))(?!\\w)(?!-)", name: "support.function.builtin.shell" }, { include: "#variable" }] } }, match: `(?:(?:(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!nocorrect |nocorrect |nocorrect$|readonly |readonly |readonly$|function |function |function$|foreach |foreach |foreach$|coproc |coproc |coproc$|logout |logout |logout$|export |export |export$|select |select |select$|repeat |repeat |repeat$|pushd |pushd |pushd$|until |until |until$|while |while |while$|local |local |local$|case |case |case$|done |done |done$|elif |elif |elif$|else |else |else$|esac |esac |esac$|popd |popd |popd$|then |then |then$|time |time |time$|for |for |for$|end |end |end$|fi |fi |fi$|do |do |do$|in |in |in$|if |if |if$))(?:((?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$))|((?!"|'|\\\\\\n?$)(?:[^!'"<> \\t\\n\\r]+?)))(?:(?= |\\t)|(?:(?=;|\\||&|\\n|\\)|\\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\))))`, name: "meta.statement.command.name.basic.shell" }, block_comment: { begin: "(?:(?:\\s*+)(\\/\\*))", beginCaptures: { 1: { name: "punctuation.definition.comment.begin.shell" } }, end: "\\*\\/", endCaptures: { 0: { name: "punctuation.definition.comment.end.shell" } }, name: "comment.block.shell" }, boolean: { match: "\\b(?:true|false)\\b", name: "constant.language.$0.shell" }, case_statement: { begin: "(?:(\\bcase\\b)(?:[ \\t]*+)(.+?)(?:[ \\t]*+)(\\bin\\b))", beginCaptures: { 1: { name: "keyword.control.case.shell" }, 2: { patterns: [{ include: "#initial_context" }] }, 3: { name: "keyword.control.in.shell" } }, end: "\\besac\\b", endCaptures: { 0: { name: "keyword.control.esac.shell" } }, name: "meta.case.shell", patterns: [{ include: "#comment" }, { captures: { 1: { name: "keyword.operator.pattern.case.default.shell" } }, match: "(?:[ \\t]*+)(\\* *\\))" }, { begin: "(?<!\\))(?!(?:[ \\t]*+)(?:esac\\b|$))", beginCaptures: {}, end: "(?:(?=\\besac\\b)|(\\)))", endCaptures: { 1: { name: "keyword.operator.pattern.case.shell" } }, name: "meta.case.entry.pattern.shell", patterns: [{ include: "#case_statement_context" }] }, { begin: "(?<=\\))", beginCaptures: {}, end: "(?:(;;)|(?=\\besac\\b))", endCaptures: { 1: { name: "punctuation.terminator.statement.case.shell" } }, name: "meta.case.entry.body.shell", patterns: [{ include: "#typical_statements" }, { include: "#initial_context" }] }] }, case_statement_context: { patterns: [{ match: "\\*", name: "variable.language.special.quantifier.star.shell keyword.operator.quantifier.star.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell" }, { match: "\\+", name: "variable.language.special.quantifier.plus.shell keyword.operator.quantifier.plus.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell" }, { match: "\\?", name: "variable.language.special.quantifier.question.shell keyword.operator.quantifier.question.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell" }, { match: "@", name: "variable.language.special.at.shell keyword.operator.at.shell punctuation.definition.regex.at.shell" }, { match: "\\|", name: "keyword.operator.orvariable.language.special.or.shell keyword.operator.alternation.ruby.shell punctuation.definition.regex.alternation.shell punctuation.separator.regex.alternation.shell" }, { match: "\\\\.", name: "constant.character.escape.shell" }, { match: "(?<=\\tin| in| |\\t|;;)\\(", name: "keyword.operator.pattern.case.shell" }, { begin: "(?<=\\S)(\\()", beginCaptures: { 1: { name: "punctuation.definition.group.shell punctuation.definition.regex.group.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.group.shell punctuation.definition.regex.group.shell" } }, name: "meta.parenthese.shell", patterns: [{ include: "#case_statement_context" }] }, { begin: "\\[", beginCaptures: { 0: { name: "punctuation.definition.character-class.shell" } }, end: "\\]", endCaptures: { 0: { name: "punctuation.definition.character-class.shell" } }, name: "string.regexp.character-class.shell", patterns: [{ match: "\\\\.", name: "constant.character.escape.shell" }] }, { include: "#string" }, { match: "[^) \\t\\n\\[\\?\\*\\|\\@]", name: "string.unquoted.pattern.shell string.regexp.unquoted.shell" }] }, command_name_range: { begin: "\\G", beginCaptures: {}, end: "(?:(?= |\\t|;|\\||&|$|\\n|\\)|\\`)|(?=<))", endCaptures: {}, name: "meta.statement.command.name.shell", patterns: [{ match: "(?<!\\w)(?:continue|return|break)(?!\\w)", name: "entity.name.function.call.shell entity.name.command.shell keyword.control.$0.shell" }, { match: "(?<!\\w)(?:(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|:|\\.)(?!\\/))(?!\\w)(?!-)", name: "entity.name.function.call.shell entity.name.command.shell support.function.builtin.shell" }, { include: "#variable" }, { captures: { 1: { name: "entity.name.function.call.shell entity.name.command.shell" } }, match: `(?:(?<!\\w)(?<=\\G|'|"|\\}|\\))([^ \\n\\t\\r"'=;&\\|\`\\)\\{<>]+))` }, { begin: `(?:(?:\\G|(?<! |\\t|;|\\||&|\\n|\\{|#))(?:(\\$?)((?:(")|(')))))`, beginCaptures: { 1: { name: "meta.statement.command.name.quoted.shell punctuation.definition.string.shell entity.name.function.call.shell entity.name.command.shell" }, 2: {}, 3: { name: "meta.statement.command.name.quoted.shell string.quoted.double.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell" }, 4: { name: "meta.statement.command.name.quoted.shell string.quoted.single.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell" } }, end: "(?<!\\G)(?<=(?:\\2))", endCaptures: {}, patterns: [{ include: "#continuation_of_single_quoted_command_name" }, { include: "#continuation_of_double_quoted_command_name" }] }, { include: "#line_continuation" }, { include: "#simple_unquoted" }] }, command_statement: { begin: "(?:(?:[ \\t]*+)(?:(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!nocorrect |nocorrect\t|nocorrect$|readonly |readonly\t|readonly$|function |function\t|function$|foreach |foreach\t|foreach$|coproc |coproc\t|coproc$|logout |logout\t|logout$|export |export\t|export$|select |select\t|select$|repeat |repeat\t|repeat$|pushd |pushd\t|pushd$|until |until\t|until$|while |while\t|while$|local |local\t|local$|case |case\t|case$|done |done\t|done$|elif |elif\t|elif$|else |else\t|else$|esac |esac\t|esac$|popd |popd\t|popd$|then |then\t|then$|time |time\t|time$|for |for\t|for$|end |end\t|end$|fi |fi\t|fi$|do |do\t|do$|in |in\t|in$|if |if\t|if$)(?!\\\\\\n?$)))", beginCaptures: {}, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.statement.command.shell", patterns: [{ include: "#command_name_range" }, { include: "#line_continuation" }, { include: "#option" }, { include: "#argument" }, { include: "#string" }, { include: "#heredoc" }] }, comment: { captures: { 1: { name: "comment.line.number-sign.shell meta.shebang.shell" }, 2: { name: "punctuation.definition.comment.shebang.shell" }, 3: { name: "comment.line.number-sign.shell" }, 4: { name: "punctuation.definition.comment.shell" } }, match: "(?:(?:^|(?:[ \\t]++))(?:((?:(#!)(?:.*)))|((?:(#)(?:.*)))))" }, comments: { patterns: [{ include: "#block_comment" }, { include: "#line_comment" }] }, "compound-command": { patterns: [{ begin: "\\[", beginCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, end: "\\]", endCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, name: "meta.scope.logical-expression.shell", patterns: [{ include: "#logical-expression" }, { include: "#initial_context" }] }, { begin: "(?<=\\s|^){(?=\\s|$)", beginCaptures: { 0: { name: "punctuation.definition.group.shell" } }, end: "(?<=^|;)\\s*(})", endCaptures: { 1: { name: "punctuation.definition.group.shell" } }, name: "meta.scope.group.shell", patterns: [{ include: "#initial_context" }] }] }, continuation_of_double_quoted_command_name: { begin: '(?:\\G(?<="))', beginCaptures: {}, contentName: "meta.statement.command.name.continuation string.quoted.double entity.name.function.call entity.name.command", end: '"', endCaptures: { 0: { name: "string.quoted.double.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell" } }, patterns: [{ match: '\\\\[\\$\\n`"\\\\]', name: "constant.character.escape.shell" }, { include: "#variable" }, { include: "#interpolation" }] }, continuation_of_single_quoted_command_name: { begin: "(?:\\G(?<='))", beginCaptures: {}, contentName: "meta.statement.command.name.continuation string.quoted.single entity.name.function.call entity.name.command", end: "'", endCaptures: { 0: { name: "string.quoted.single.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell" } } }, custom_command_names: { patterns: [] }, custom_commands: { patterns: [] }, double_quote_context: { patterns: [{ match: '\\\\[\\$`"\\\\\\n]', name: "constant.character.escape.shell" }, { include: "#variable" }, { include: "#interpolation" }] }, double_quote_escape_char: { match: '\\\\[\\$`"\\\\\\n]', name: "constant.character.escape.shell" }, floating_keyword: { patterns: [{ match: "(?<=^|;|&| |\\t)(?:then|elif|else|done|end|do|if|fi)(?= |\\t|;|&|$)", name: "keyword.control.$0.shell" }] }, for_statement: { patterns: [{ begin: "(?:(\\bfor\\b)(?:(?:[ \\t]*+)((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:[ \\t]*+)(\\bin\\b)))", beginCaptures: { 1: { name: "keyword.control.for.shell" }, 2: { name: "variable.other.for.shell" }, 3: { name: "keyword.control.in.shell" } }, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.for.in.shell", patterns: [{ include: "#string" }, { include: "#simple_unquoted" }, { include: "#normal_context" }] }, { begin: "(\\bfor\\b)", beginCaptures: { 1: { name: "keyword.control.for.shell" } }, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.for.shell", patterns: [{ include: "#arithmetic_double" }, { include: "#normal_context" }] }] }, function_definition: { applyEndPatternLast: 1, begin: `(?:[ \\t]*+)(?:(?:(\\bfunction\\b)(?:[ \\t]*+)([^ \\t\\n\\r\\(\\)="']+)(?:(?:(\\()(?:[ \\t]*+)(\\)))?))|(?:([^ \\t\\n\\r\\(\\)="']+)(?:[ \\t]*+)(\\()(?:[ \\t]*+)(\\))))`, beginCaptures: { 1: { name: "storage.type.function.shell" }, 2: { name: "entity.name.function.shell" }, 3: { name: "punctuation.definition.arguments.shell" }, 4: { name: "punctuation.definition.arguments.shell" }, 5: { name: "entity.name.function.shell" }, 6: { name: "punctuation.definition.arguments.shell" }, 7: { name: "punctuation.definition.arguments.shell" } }, end: "(?<=\\}|\\))", endCaptures: {}, name: "meta.function.shell", patterns: [{ match: "(?:\\G(?:\\t| |\\n))" }, { begin: "\\{", beginCaptures: { 0: { name: "punctuation.definition.group.shell punctuation.section.function.definition.shell" } }, end: "\\}", endCaptures: { 0: { name: "punctuation.definition.group.shell punctuation.section.function.definition.shell" } }, name: "meta.function.body.shell", patterns: [{ include: "#initial_context" }] }, { begin: "\\(", beginCaptures: { 0: { name: "punctuation.definition.group.shell punctuation.section.function.definition.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.group.shell punctuation.section.function.definition.shell" } }, name: "meta.function.body.shell", patterns: [{ include: "#initial_context" }] }, { include: "#initial_context" }] }, heredoc: { patterns: [{ begin: `(?:((?<!<)(?:<<-))(?:[ \\t]*+)("|')(?:[ \\t]*+)([^"']+?)(?=\\s|;|&|<|"|')((?:\\2))(.*))`, beginCaptures: { 1: { name: "keyword.operator.heredoc.shell" }, 2: { name: "punctuation.definition.string.heredoc.quote.shell" }, 3: { name: "punctuation.definition.string.heredoc.delimiter.shell" }, 4: { name: "punctuation.definition.string.heredoc.quote.shell" }, 5: { patterns: [{ include: "#redirect_fix" }, { include: "#typical_statements" }] } }, contentName: "string.quoted.heredoc.indent.$3", end: "(?:(?:^\\t*)(?:\\3)(?=\\s|;|&|$))", endCaptures: { 0: { name: "punctuation.definition.string.heredoc.$0.shell" } }, patterns: [] }, { begin: `(?:((?<!<)(?:<<)(?!<))(?:[ \\t]*+)("|')(?:[ \\t]*+)([^"']+?)(?=\\s|;|&|<|"|')((?:\\2))(.*))`, beginCaptures: { 1: { name: "keyword.operator.heredoc.shell" }, 2: { name: "punctuation.definition.string.heredoc.quote.shell" }, 3: { name: "punctuation.definition.string.heredoc.delimiter.shell" }, 4: { name: "punctuation.definition.string.heredoc.quote.shell" }, 5: { patterns: [{ include: "#redirect_fix" }, { include: "#typical_statements" }] } }, contentName: "string.quoted.heredoc.no-indent.$3", end: "(?:^(?:\\3)(?=\\s|;|&|$))", endCaptures: { 0: { name: "punctuation.definition.string.heredoc.delimiter.shell" } }, patterns: [] }, { begin: `(?:((?<!<)(?:<<-))(?:[ \\t]*+)([^"' \\t]+)(?=\\s|;|&|<|"|')(.*))`, beginCaptures: { 1: { name: "keyword.operator.heredoc.shell" }, 2: { name: "punctuation.definition.string.heredoc.delimiter.shell" }, 3: { patterns: [{ include: "#redirect_fix" }, { include: "#typical_statements" }] } }, contentName: "string.unquoted.heredoc.indent.$2", end: "(?:(?:^\\t*)(?:\\2)(?=\\s|;|&|$))", endCaptures: { 0: { name: "punctuation.definition.string.heredoc.delimiter.shell" } }, patterns: [{ include: "#double_quote_escape_char" }, { include: "#variable" }, { include: "#interpolation" }] }, { begin: `(?:((?<!<)(?:<<)(?!<))(?:[ \\t]*+)([^"' \\t]+)(?=\\s|;|&|<|"|')(.*))`, beginCaptures: { 1: { name: "keyword.operator.heredoc.shell" }, 2: { name: "punctuation.definition.string.heredoc.delimiter.shell" }, 3: { patterns: [{ include: "#redirect_fix" }, { include: "#typical_statements" }] } }, contentName: "string.unquoted.heredoc.no-indent.$2", end: "(?:^(?:\\2)(?=\\s|;|&|$))", endCaptures: { 0: { name: "punctuation.definition.string.heredoc.delimiter.shell" } }, patterns: [{ include: "#double_quote_escape_char" }, { include: "#variable" }, { include: "#interpolation" }] }] }, herestring: { patterns: [{ begin: "(<<<)\\s*(('))", beginCaptures: { 1: { name: "keyword.operator.herestring.shell" }, 2: { name: "string.quoted.single.shell" }, 3: { name: "punctuation.definition.string.begin.shell" } }, contentName: "string.quoted.single.shell", end: "(')", endCaptures: { 0: { name: "string.quoted.single.shell" }, 1: { name: "punctuation.definition.string.end.shell" } }, name: "meta.herestring.shell" }, { begin: '(<<<)\\s*(("))', beginCaptures: { 1: { name: "keyword.operator.herestring.shell" }, 2: { name: "string.quoted.double.shell" }, 3: { name: "punctuation.definition.string.begin.shell" } }, contentName: "string.quoted.double.shell", end: '(")', endCaptures: { 0: { name: "string.quoted.double.shell" }, 1: { name: "punctuation.definition.string.end.shell" } }, name: "meta.herestring.shell", patterns: [{ include: "#double_quote_context" }] }, { captures: { 1: { name: "keyword.operator.herestring.shell" }, 2: { name: "string.unquoted.herestring.shell", patterns: [{ include: "#initial_context" }] } }, match: "(<<<)\\s*(([^\\s)\\\\]|\\\\.)+)", name: "meta.herestring.shell" }] }, initial_context: { patterns: [{ include: "#comment" }, { include: "#pipeline" }, { include: "#normal_statement_seperator" }, { include: "#logical_expression_double" }, { include: "#logical_expression_single" }, { include: "#assignment_statement" }, { include: "#case_statement" }, { include: "#for_statement" }, { include: "#loop" }, { include: "#function_definition" }, { include: "#line_continuation" }, { include: "#arithmetic_double" }, { include: "#misc_ranges" }, { include: "#variable" }, { include: "#interpolation" }, { include: "#heredoc" }, { include: "#herestring" }, { include: "#redirection" }, { include: "#pathname" }, { include: "#floating_keyword" }, { include: "#alias_statement" }, { include: "#normal_statement" }, { include: "#string" }, { include: "#support" }] }, inline_comment: { captures: { 1: { name: "comment.block.shell punctuation.definition.comment.begin.shell" }, 2: { name: "comment.block.shell" }, 3: { patterns: [{ match: "\\*\\/", name: "comment.block.shell punctuation.definition.comment.end.shell" }, { match: "\\*", name: "comment.block.shell" }] } }, match: "(\\/\\*)((?:(?:[^\\*]|(?:(?:\\*++)[^\\/]))*+)((?:(?:\\*++)\\/)))" }, interpolation: { patterns: [{ include: "#arithmetic_dollar" }, { include: "#subshell_dollar" }, { begin: "`", beginCaptures: { 0: { name: "punctuation.definition.evaluation.backticks.shell" } }, end: "`", endCaptures: { 0: { name: "punctuation.definition.evaluation.backticks.shell" } }, name: "string.interpolated.backtick.shell", patterns: [{ match: "\\\\[`\\\\$]", name: "constant.character.escape.shell" }, { begin: "(?<=\\W)(?=#)(?!#{)", beginCaptures: { 1: { name: "punctuation.whitespace.comment.leading.shell" } }, end: "(?!\\G)", patterns: [{ begin: "#", beginCaptures: { 0: { name: "punctuation.definition.comment.shell" } }, end: "(?=`)", name: "comment.line.number-sign.shell" }] }, { include: "#initial_context" }] }] }, keyword: { patterns: [{ match: "(?<=^|;|&|\\s)(then|else|elif|fi|for|in|do|done|select|continue|esac|while|until|return)(?=\\s|;|&|$)", name: "keyword.control.shell" }, { match: "(?<=^|;|&|\\s)(?:export|declare|typeset|local|readonly)(?=\\s|;|&|$)", name: "storage.modifier.shell" }] }, line_comment: { begin: "(?:\\s*+)(\\/\\/)", beginCaptures: { 1: { name: "punctuation.definition.comment.shell" } }, end: "(?<=\\n)(?<!\\\\\\n)", endCaptures: {}, name: "comment.line.double-slash.shell", patterns: [{ include: "#line_continuation_character" }] }, line_continuation: { match: "\\\\(?=\\n)", name: "constant.character.escape.line-continuation.shell" }, "logical-expression": { patterns: [{ include: "#arithmetic_no_dollar" }, { comment: "do we want a special rule for ( expr )?", match: "=[=~]?|!=?|<|>|&&|\\|\\|", name: "keyword.operator.logical.shell" }, { match: "(?<!\\S)-(nt|ot|ef|eq|ne|l[te]|g[te]|[a-hknoprstuwxzOGLSN])\\b", name: "keyword.operator.logical.shell" }] }, logical_expression_context: { patterns: [{ include: "#regex_comparison" }, { include: "#arithmetic_no_dollar" }, { include: "#logical-expression" }, { include: "#logical_expression_single" }, { include: "#logical_expression_double" }, { include: "#comment" }, { include: "#boolean" }, { include: "#redirect_number" }, { include: "#numeric_literal" }, { include: "#pipeline" }, { include: "#normal_statement_seperator" }, { include: "#string" }, { include: "#variable" }, { include: "#interpolation" }, { include: "#heredoc" }, { include: "#herestring" }, { include: "#pathname" }, { include: "#floating_keyword" }, { include: "#support" }] }, logical_expression_double: { begin: "\\[\\[", beginCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, end: "\\]\\]", endCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, name: "meta.scope.logical-expression.shell", patterns: [{ include: "#logical_expression_context" }] }, logical_expression_single: { begin: "\\[", beginCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, end: "\\]", endCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, name: "meta.scope.logical-expression.shell", patterns: [{ include: "#logical_expression_context" }] }, loop: { patterns: [{ begin: "(?<=^|;|&|\\s)(for)\\s+(.+?)\\s+(in)(?=\\s|;|&|$)", beginCaptures: { 1: { name: "keyword.control.shell" }, 2: { name: "variable.other.loop.shell", patterns: [{ include: "#string" }] }, 3: { name: "keyword.control.shell" } }, end: "(?<=^|;|&|\\s)done(?=\\s|;|&|$|\\))", endCaptures: { 0: { name: "keyword.control.shell" } }, name: "meta.scope.for-in-loop.shell", patterns: [{ include: "#initial_context" }] }, { begin: "(?<=^|;|&|\\s)(while|until)(?=\\s|;|&|$)", beginCaptures: { 1: { name: "keyword.control.shell" } }, end: "(?<=^|;|&|\\s)done(?=\\s|;|&|$|\\))", endCaptures: { 0: { name: "keyword.control.shell" } }, name: "meta.scope.while-loop.shell", patterns: [{ include: "#initial_context" }] }, { begin: "(?<=^|;|&|\\s)(select)\\s+((?:[^\\s\\\\]|\\\\.)+)(?=\\s|;|&|$)", beginCaptures: { 1: { name: "keyword.control.shell" }, 2: { name: "variable.other.loop.shell" } }, end: "(?<=^|;|&|\\s)(done)(?=\\s|;|&|$|\\))", endCaptures: { 1: { name: "keyword.control.shell" } }, name: "meta.scope.select-block.shell", patterns: [{ include: "#initial_context" }] }, { begin: "(?<=^|;|&|\\s)if(?=\\s|;|&|$)", beginCaptures: { 0: { name: "keyword.control.if.shell" } }, end: "(?<=^|;|&|\\s)fi(?=\\s|;|&|$)", endCaptures: { 0: { name: "keyword.control.fi.shell" } }, name: "meta.scope.if-block.shell", patterns: [{ include: "#initial_context" }] }] }, math: { patterns: [{ include: "#variable" }, { match: "\\+{1,2}|-{1,2}|!|~|\\*{1,2}|/|%|<[<=]?|>[>=]?|==|!=|^|\\|{1,2}|&{1,2}|\\?|\\:|,|=|[*/%+\\-&^|]=|<<=|>>=", name: "keyword.operator.arithmetic.shell" }, { match: "0[xX][0-9A-Fa-f]+", name: "constant.numeric.hex.shell" }, { match: ";", name: "punctuation.separator.semicolon.range" }, { match: "0\\d+", name: "constant.numeric.octal.shell" }, { match: "\\d{1,2}#[0-9a-zA-Z@_]+", name: "constant.numeric.other.shell" }, { match: "\\d+", name: "constant.numeric.integer.shell" }, { match: "(?<!\\w)(?:[a-zA-Z_0-9]+)(?!\\w)", name: "variable.other.normal.shell" }] }, math_operators: { patterns: [{ match: "\\+{1,2}|-{1,2}|!|~|\\*{1,2}|/|%|<[<=]?|>[>=]?|==|!=|^|\\|{1,2}|&{1,2}|\\?|\\:|,|=|[*/%+\\-&^|]=|<<=|>>=", name: "keyword.operator.arithmetic.shell" }, { match: "0[xX][0-9A-Fa-f]+", name: "constant.numeric.hex.shell" }, { match: "0\\d+", name: "constant.numeric.octal.shell" }, { match: "\\d{1,2}#[0-9a-zA-Z@_]+", name: "constant.numeric.other.shell" }, { match: "\\d+", name: "constant.numeric.integer.shell" }] }, misc_ranges: { patterns: [{ include: "#logical_expression_single" }, { include: "#logical_expression_double" }, { include: "#subshell_dollar" }, { begin: "(?<![^ \\t])({)(?!\\w|\\$)", beginCaptures: { 1: { name: "punctuation.definition.group.shell" } }, end: "}", endCaptures: { 0: { name: "punctuation.definition.group.shell" } }, name: "meta.scope.group.shell", patterns: [{ include: "#initial_context" }] }] }, modified_assignment_statement: { begin: "(?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$)", beginCaptures: { 0: { name: "storage.modifier.$0.shell" } }, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.statement.shell meta.expression.assignment.modified.shell", patterns: [{ match: "(?<!\\w)-\\w+\\b", name: "string.unquoted.argument.shell constant.other.option.shell" }, { include: "#array_value" }, { captures: { 1: { name: "variable.other.assignment.shell" }, 2: { name: "punctuation.definition.array.access.shell" }, 3: { name: "variable.other.assignment.shell" }, 4: { name: "constant.numeric.shell constant.numeric.integer.shell" }, 5: { name: "punctuation.definition.array.access.shell" }, 6: { name: "keyword.operator.assignment.shell" }, 7: { name: "keyword.operator.assignment.compound.shell" }, 8: { name: "keyword.operator.assignment.compound.shell" }, 9: { name: "constant.numeric.shell constant.numeric.hex.shell" }, 10: { name: "constant.numeric.shell constant.numeric.octal.shell" }, 11: { name: "constant.numeric.shell constant.numeric.other.shell" }, 12: { name: "constant.numeric.shell constant.numeric.decimal.shell" }, 13: { name: "constant.numeric.shell constant.numeric.version.shell" }, 14: { name: "constant.numeric.shell constant.numeric.integer.shell" } }, match: "(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:(?:(\\[)((?:(?:(?:(?:\\$?)(?:(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))|@)|\\*)|(-?\\d+)))(\\]))?)(?:(?:(?:(\\=)|(\\+\\=))|(\\-\\=))?)(?:(?:(?<==| |\\t|^|\\{|\\(|\\[)(?:(?:(?:(?:(?:(0[xX][0-9A-Fa-f]+)|(0\\d+))|(\\d{1,2}#[0-9a-zA-Z@_]+))|(-?\\d+(?:\\.\\d+)))|(-?\\d+(?:\\.\\d+)+))|(-?\\d+))(?= |\\t|$|\\}|\\)|;))?))" }, { include: "#normal_context" }] }, modifiers: { match: "(?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$)", name: "storage.modifier.$0.shell" }, normal_assignment_statement: { begin: "(?:[ \\t]*+)(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:(?:(\\[)((?:(?:(?:(?:\\$?)(?:(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))|@)|\\*)|(-?\\d+)))(\\]))?))(?:(?:(\\=)|(\\+\\=))|(\\-\\=))", beginCaptures: { 1: { name: "variable.other.assignment.shell" }, 2: { name: "punctuation.definition.array.access.shell" }, 3: { name: "variable.other.assignment.shell" }, 4: { name: "constant.numeric.shell constant.numeric.integer.shell" }, 5: { name: "punctuation.definition.array.access.shell" }, 6: { name: "keyword.operator.assignment.shell" }, 7: { name: "keyword.operator.assignment.compound.shell" }, 8: { name: "keyword.operator.assignment.compound.shell" } }, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.expression.assignment.shell", patterns: [{ include: "#comment" }, { include: "#string" }, { include: "#normal_assignment_statement" }, { begin: "(?<= |\\t)(?! |\\t|\\w+=)", beginCaptures: {}, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.statement.command.env.shell", patterns: [{ include: "#command_name_range" }, { include: "#line_continuation" }, { include: "#option" }, { include: "#argument" }, { include: "#string" }] }, { include: "#simple_unquoted" }, { include: "#normal_context" }] }, normal_context: { patterns: [{ include: "#comment" }, { include: "#pipeline" }, { include: "#normal_statement_seperator" }, { include: "#misc_ranges" }, { include: "#boolean" }, { include: "#redirect_number" }, { include: "#numeric_literal" }, { include: "#string" }, { include: "#variable" }, { include: "#interpolation" }, { include: "#heredoc" }, { include: "#herestring" }, { include: "#redirection" }, { include: "#pathname" }, { include: "#floating_keyword" }, { include: "#support" }, { include: "#parenthese" }] }, normal_statement: { begin: "(?:(?!^[ \\t]*+$)(?:(?<=^until | until |\\tuntil |^while | while |\\twhile |^elif | elif |\\telif |^else | else |\\telse |^then | then |\\tthen |^do | do |\\tdo |^if | if |\\tif )|(?<=(?:^|;|\\||&|!|\\(|\\{|\\`)))(?:[ \\t]*+)(?!nocorrect\\W|nocorrect\\$|function\\W|function\\$|foreach\\W|foreach\\$|repeat\\W|repeat\\$|logout\\W|logout\\$|coproc\\W|coproc\\$|select\\W|select\\$|while\\W|while\\$|pushd\\W|pushd\\$|until\\W|until\\$|case\\W|case\\$|done\\W|done\\$|elif\\W|elif\\$|else\\W|else\\$|esac\\W|esac\\$|popd\\W|popd\\$|then\\W|then\\$|time\\W|time\\$|for\\W|for\\$|end\\W|end\\$|fi\\W|fi\\$|do\\W|do\\$|in\\W|in\\$|if\\W|if\\$))", beginCaptures: {}, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.statement.shell", patterns: [{ include: "#typical_statements" }] }, normal_statement_seperator: { captures: { 1: { name: "punctuation.terminator.statement.semicolon.shell" }, 2: { name: "punctuation.separator.statement.and.shell" }, 3: { name: "punctuation.separator.statement.or.shell" }, 4: { name: "punctuation.separator.statement.background.shell" } }, match: "(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))" }, numeric_literal: { captures: { 1: { name: "constant.numeric.shell constant.numeric.hex.shell" }, 2: { name: "constant.numeric.shell constant.numeric.octal.shell" }, 3: { name: "constant.numeric.shell constant.numeric.other.shell" }, 4: { name: "constant.numeric.shell constant.numeric.decimal.shell" }, 5: { name: "constant.numeric.shell constant.numeric.version.shell" }, 6: { name: "constant.numeric.shell constant.numeric.integer.shell" } }, match: "(?<==| |\\t|^|\\{|\\(|\\[)(?:(?:(?:(?:(?:(0[xX][0-9A-Fa-f]+)|(0\\d+))|(\\d{1,2}#[0-9a-zA-Z@_]+))|(-?\\d+(?:\\.\\d+)))|(-?\\d+(?:\\.\\d+)+))|(-?\\d+))(?= |\\t|$|\\}|\\)|;)" }, option: { begin: "(?:(?:[ \\t]++)(-)((?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))))", beginCaptures: { 1: { name: "string.unquoted.argument.shell constant.other.option.dash.shell" }, 2: { name: "string.unquoted.argument.shell constant.other.option.shell" } }, contentName: "string.unquoted.argument constant.other.option", end: "(?:(?=[ \\t])|(?:(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)))", endCaptures: {}, patterns: [{ include: "#option_context" }] }, option_context: { patterns: [{ include: "#misc_ranges" }, { include: "#string" }, { include: "#variable" }, { include: "#interpolation" }, { include: "#heredoc" }, { include: "#herestring" }, { include: "#redirection" }, { include: "#pathname" }, { include: "#floating_keyword" }, { include: "#support" }] }, parenthese: { patterns: [{ begin: "\\(", beginCaptures: { 0: { name: "punctuation.section.parenthese.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.section.parenthese.shell" } }, name: "meta.parenthese.group.shell", patterns: [{ include: "#initial_context" }] }] }, pathname: { patterns: [{ match: "(?<=\\s|:|=|^)~", name: "keyword.operator.tilde.shell" }, { match: "\\*|\\?", name: "keyword.operator.glob.shell" }, { begin: "([?*+@!])(\\()", beginCaptures: { 1: { name: "keyword.operator.extglob.shell" }, 2: { name: "punctuation.definition.extglob.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.extglob.shell" } }, name: "meta.structure.extglob.shell", patterns: [{ include: "#initial_context" }] }] }, pipeline: { patterns: [{ match: "(?<=^|;|&|\\s)(time)(?=\\s|;|&|$)", name: "keyword.other.shell" }, { match: "[|!]", name: "keyword.operator.pipe.shell" }] }, redirect_fix: { captures: { 1: { name: "keyword.operator.redirect.shell" }, 2: { name: "string.unquoted.argument.shell" } }, match: "(?:(>>?)(?:[ \\t]*+)([^ \\t\\n>&;<>\\(\\)\\$`\\\\\"'<\\|]+))" }, redirect_number: { captures: { 1: { name: "keyword.operator.redirect.stdout.shell" }, 2: { name: "keyword.operator.redirect.stderr.shell" }, 3: { name: "keyword.operator.redirect.$3.shell" } }, match: "(?<=[ \\t])(?:(?:(1)|(2)|(\\d+))(?=>))" }, redirection: { patterns: [{ begin: "[><]\\(", beginCaptures: { 0: { name: "punctuation.definition.string.begin.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.string.end.shell" } }, name: "string.interpolated.process-substitution.shell", patterns: [{ include: "#initial_context" }] }, { match: "(?<![<>])(&>|\\d*>&\\d*|\\d*(>>|>|<)|\\d*<&|\\d*<>)(?![<>])", name: "keyword.operator.redirect.shell" }] }, regex_comparison: { match: "\\=~", name: "keyword.operator.logical.regex.shell" }, regexp: { patterns: [{ match: "(?:.+)" }] }, simple_options: { captures: { 0: { patterns: [{ captures: { 1: { name: "string.unquoted.argument.shell constant.other.option.dash.shell" }, 2: { name: "string.unquoted.argument.shell constant.other.option.shell" } }, match: "(?:[ \\t]++)(\\-)(\\w+)" }] } }, match: "(?:(?:[ \\t]++)\\-(?:\\w+))*" }, simple_unquoted: { match: "[^ \\t\\n>&;<>\\(\\)\\$`\\\\\"'<\\|]", name: "string.unquoted.shell" }, special_expansion: { match: "!|:[-=?]?|\\*|@|##|#|%%|%|\\/", name: "keyword.operator.expansion.shell" }, start_of_command: { match: "(?:(?:[ \\t]*+)(?:(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!nocorrect |nocorrect\t|nocorrect$|readonly |readonly\t|readonly$|function |function\t|function$|foreach |foreach\t|foreach$|coproc |coproc\t|coproc$|logout |logout\t|logout$|export |export\t|export$|select |select\t|select$|repeat |repeat\t|repeat$|pushd |pushd\t|pushd$|until |until\t|until$|while |while\t|while$|local |local\t|local$|case |case\t|case$|done |done\t|done$|elif |elif\t|elif$|else |else\t|else$|esac |esac\t|esac$|popd |popd\t|popd$|then |then\t|then$|time |time\t|time$|for |for\t|for$|end |end\t|end$|fi |fi\t|fi$|do |do\t|do$|in |in\t|in$|if |if\t|if$)(?!\\\\\\n?$)))" }, string: { patterns: [{ match: "\\\\.", name: "constant.character.escape.shell" }, { begin: "'", beginCaptures: { 0: { name: "punctuation.definition.string.begin.shell" } }, end: "'", endCaptures: { 0: { name: "punctuation.definition.string.end.shell" } }, name: "string.quoted.single.shell" }, { begin: '\\$?"', beginCaptures: { 0: { name: "punctuation.definition.string.begin.shell" } }, end: '"', endCaptures: { 0: { name: "punctuation.definition.string.end.shell" } }, name: "string.quoted.double.shell", patterns: [{ match: '\\\\[\\$\\n`"\\\\]', name: "constant.character.escape.shell" }, { include: "#variable" }, { include: "#interpolation" }] }, { begin: "\\$'", beginCaptures: { 0: { name: "punctuation.definition.string.begin.shell" } }, end: "'", endCaptures: { 0: { name: "punctuation.definition.string.end.shell" } }, name: "string.quoted.single.dollar.shell", patterns: [{ match: "\\\\(?:a|b|e|f|n|r|t|v|\\\\|')", name: "constant.character.escape.ansi-c.shell" }, { match: '\\\\[0-9]{3}"', name: "constant.character.escape.octal.shell" }, { match: '\\\\x[0-9a-fA-F]{2}"', name: "constant.character.escape.hex.shell" }, { match: '\\\\c."', name: "constant.character.escape.control-char.shell" }] }] }, subshell_dollar: { patterns: [{ begin: "(?:\\$\\()", beginCaptures: { 0: { name: "punctuation.definition.subshell.single.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.subshell.single.shell" } }, name: "meta.scope.subshell", patterns: [{ include: "#parenthese" }, { include: "#initial_context" }] }] }, support: { patterns: [{ match: "(?<=^|;|&|\\s)(?::|\\.)(?=\\s|;|&|$)", name: "support.function.builtin.shell" }] }, typical_statements: { patterns: [{ include: "#assignment_statement" }, { include: "#case_statement" }, { include: "#for_statement" }, { include: "#while_statement" }, { include: "#function_definition" }, { include: "#command_statement" }, { include: "#line_continuation" }, { include: "#arithmetic_double" }, { include: "#normal_context" }] }, variable: { patterns: [{ captures: { 1: { name: "punctuation.definition.variable.shell variable.parameter.positional.all.shell" }, 2: { name: "variable.parameter.positional.all.shell" } }, match: "(?:(\\$)(\\@(?!\\w)))" }, { captures: { 1: { name: "punctuation.definition.variable.shell variable.parameter.positional.shell" }, 2: { name: "variable.parameter.positional.shell" } }, match: "(?:(\\$)([0-9](?!\\w)))" }, { captures: { 1: { name: "punctuation.definition.variable.shell variable.language.special.shell" }, 2: { name: "variable.language.special.shell" } }, match: "(?:(\\$)([-*#?$!0_](?!\\w)))" }, { begin: "(?:(\\$)(\\{)(?:[ \\t]*+)(?=\\d))", beginCaptures: { 1: { name: "punctuation.definition.variable.shell variable.parameter.positional.shell" }, 2: { name: "punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell variable.parameter.positional.shell" } }, contentName: "meta.parameter-expansion", end: "\\}", endCaptures: { 0: { name: "punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell variable.parameter.positional.shell" } }, patterns: [{ include: "#special_expansion" }, { include: "#array_access_inline" }, { match: "[0-9]+", name: "variable.parameter.positional.shell" }, { match: "(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w)", name: "variable.other.normal.shell" }, { include: "#variable" }, { include: "#string" }] }, { begin: "(?:(\\$)(\\{))", beginCaptures: { 1: { name: "punctuation.definition.variable.shell" }, 2: { name: "punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell" } }, contentName: "meta.parameter-expansion", end: "\\}", endCaptures: { 0: { name: "punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell" } }, patterns: [{ include: "#special_expansion" }, { include: "#array_access_inline" }, { match: "(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w)", name: "variable.other.normal.shell" }, { include: "#variable" }, { include: "#string" }] }, { captures: { 1: { name: "punctuation.definition.variable.shell variable.other.normal.shell" }, 2: { name: "variable.other.normal.shell" } }, match: "(?:(\\$)((?:\\w+)(?!\\w)))" }] }, while_statement: { patterns: [{ begin: "(\\bwhile\\b)", beginCaptures: { 1: { name: "keyword.control.while.shell" } }, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.while.shell", patterns: [{ include: "#line_continuation" }, { include: "#math_operators" }, { include: "#option" }, { include: "#simple_unquoted" }, { include: "#normal_context" }, { include: "#string" }] }] } };
|
|
61151
61151
|
l18 = { displayName: e163, name: n156, patterns: t161, repository: a160, scopeName: i113 };
|
|
61152
61152
|
});
|
|
61153
61153
|
var exports_shellsession = {};
|
|
@@ -82987,7 +82987,7 @@ var i270 = "source.shell";
|
|
|
82987
82987
|
var l43;
|
|
82988
82988
|
var init_shellscript2 = __esm2(() => {
|
|
82989
82989
|
t404 = [{ include: "#initial_context" }];
|
|
82990
|
-
a384 = { alias_statement: { begin: "(?:(?:[ \\t]*+)(alias)(?:[ \\t]*+)((?:(?:((?<!\\w)-\\w+\\b)(?:[ \\t]*+))*))(?:(?:[ \\t]*+)(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:(?:(\\[)((?:(?:(?:(?:\\$?)(?:(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))|@)|\\*)|(-?\\d+)))(\\]))?))(?:(?:(=)|(\\+=))|(-=))))", beginCaptures: { 1: { name: "storage.type.alias.shell" }, 2: { patterns: [{ match: "(?<!\\w)-\\w+\\b", name: "string.unquoted.argument.shell constant.other.option.shell" }] }, 3: { name: "string.unquoted.argument.shell constant.other.option.shell" }, 4: { name: "variable.other.assignment.shell" }, 5: { name: "punctuation.definition.array.access.shell" }, 6: { name: "variable.other.assignment.shell" }, 7: { name: "constant.numeric.shell constant.numeric.integer.shell" }, 8: { name: "punctuation.definition.array.access.shell" }, 9: { name: "keyword.operator.assignment.shell" }, 10: { name: "keyword.operator.assignment.compound.shell" }, 11: { name: "keyword.operator.assignment.compound.shell" } }, end: "(?:(?= |\\t|$)|(?:(?:(?:(;)|(&&))|(\\|\\|))|(&)))", endCaptures: { 1: { name: "punctuation.terminator.statement.semicolon.shell" }, 2: { name: "punctuation.separator.statement.and.shell" }, 3: { name: "punctuation.separator.statement.or.shell" }, 4: { name: "punctuation.separator.statement.background.shell" } }, name: "meta.expression.assignment.alias.shell", patterns: [{ include: "#normal_context" }] }, argument: { begin: "(?:[ \\t]++)(?!(?:&|\\||\\(|\\[|#|\\n|$|;))", beginCaptures: {}, end: "(?= |\\t|;|\\||&|$|\\n|\\)|\\`)", endCaptures: {}, name: "meta.argument.shell", patterns: [{ include: "#argument_context" }, { include: "#line_continuation" }] }, argument_context: { patterns: [{ captures: { 1: { name: "string.unquoted.argument.shell", patterns: [{ match: "\\*", name: "variable.language.special.wildcard.shell" }, { include: "#variable" }, { include: "#numeric_literal" }, { captures: { 1: { name: "constant.language.$1.shell" } }, match: "(?<!\\w)(\\b(?:true|false)\\b)(?!\\w)" }] } }, match: "(?:[ \\t]*+)((?:[^ \\t\\n>&;<>()$`\\\\\"'<\\|]+)(?!>))" }, { include: "#normal_context" }] }, arithmetic_double: { patterns: [{ begin: "\\(\\(", beginCaptures: { 0: { name: "punctuation.section.arithmetic.double.shell" } }, end: "\\)(?:\\s*)\\)", endCaptures: { 0: { name: "punctuation.section.arithmetic.double.shell" } }, name: "meta.arithmetic.shell", patterns: [{ include: "#math" }, { include: "#string" }] }] }, arithmetic_no_dollar: { patterns: [{ begin: "\\(", beginCaptures: { 0: { name: "punctuation.section.arithmetic.single.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.section.arithmetic.single.shell" } }, name: "meta.arithmetic.shell", patterns: [{ include: "#math" }, { include: "#string" }] }] }, array_access_inline: { captures: { 1: { name: "punctuation.section.array.shell" }, 2: { patterns: [{ include: "#special_expansion" }, { include: "#string" }, { include: "#variable" }] }, 3: { name: "punctuation.section.array.shell" } }, match: "(?:(\\[)([^\\[\\]]+)(\\]))" }, array_value: { begin: "(?:[ \\t]*+)(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:(?:(\\[)((?:(?:(?:(?:\\$?)(?:(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))|@)|\\*)|(-?\\d+)))(\\]))?))(?:(?:(=)|(\\+=))|(-=))(?:[ \\t]*+)(\\()", beginCaptures: { 1: { name: "variable.other.assignment.shell" }, 2: { name: "punctuation.definition.array.access.shell" }, 3: { name: "variable.other.assignment.shell" }, 4: { name: "constant.numeric.shell constant.numeric.integer.shell" }, 5: { name: "punctuation.definition.array.access.shell" }, 6: { name: "keyword.operator.assignment.shell" }, 7: { name: "keyword.operator.assignment.compound.shell" }, 8: { name: "keyword.operator.assignment.compound.shell" }, 9: { name: "punctuation.definition.array.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.array.shell" } }, patterns: [{ include: "#comment" }, { captures: { 1: { name: "variable.other.assignment.array.shell entity.other.attribute-name.shell" }, 2: { name: "keyword.operator.assignment.shell punctuation.definition.assignment.shell" } }, match: "(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(=))" }, { captures: { 1: { name: "punctuation.definition.bracket.named-array.shell" }, 2: { name: "string.unquoted.shell entity.other.attribute-name.bracket.shell" }, 3: { name: "punctuation.definition.bracket.named-array.shell" }, 4: { name: "punctuation.definition.assignment.shell" } }, match: "(?:(\\[)(.+?)(\\])(=))" }, { include: "#normal_context" }, { include: "#simple_unquoted" }] }, assignment_statement: { patterns: [{ include: "#array_value" }, { include: "#modified_assignment_statement" }, { include: "#normal_assignment_statement" }] }, basic_command_name: { captures: { 1: { name: "storage.modifier.$1.shell" }, 2: { name: "entity.name.function.call.shell entity.name.command.shell", patterns: [{ match: "(?<!\\w)(?:continue|return|break)(?!\\w)", name: "keyword.control.$0.shell" }, { match: "(?<!\\w)(?:(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|:|\\.)(?!\\/))(?!\\w)(?!-)", name: "support.function.builtin.shell" }, { include: "#variable" }] } }, match: `(?:(?:(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!nocorrect |nocorrect |nocorrect$|readonly |readonly |readonly$|function |function |function$|foreach |foreach |foreach$|coproc |coproc |coproc$|logout |logout |logout$|export |export |export$|select |select |select$|repeat |repeat |repeat$|pushd |pushd |pushd$|until |until |until$|while |while |while$|local |local |local$|case |case |case$|done |done |done$|elif |elif |elif$|else |else |else$|esac |esac |esac$|popd |popd |popd$|then |then |then$|time |time |time$|for |for |for$|end |end |end$|fi |fi |fi$|do |do |do$|in |in |in$|if |if |if$))(?:((?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$))|((?!"|'|\\\\\\n?$)(?:[^!'"<> \\t\\n\\r]+?)))(?:(?= |\\t)|(?:(?=;|\\||&|\\n|\\)|\\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\))))`, name: "meta.statement.command.name.basic.shell" }, block_comment: { begin: "(?:(?:\\s*+)(\\/\\*))", beginCaptures: { 1: { name: "punctuation.definition.comment.begin.shell" } }, end: "\\*\\/", endCaptures: { 0: { name: "punctuation.definition.comment.end.shell" } }, name: "comment.block.shell" }, boolean: { match: "\\b(?:true|false)\\b", name: "constant.language.$0.shell" }, case_statement: { begin: "(?:(\\bcase\\b)(?:[ \\t]*+)(.+?)(?:[ \\t]*+)(\\bin\\b))", beginCaptures: { 1: { name: "keyword.control.case.shell" }, 2: { patterns: [{ include: "#initial_context" }] }, 3: { name: "keyword.control.in.shell" } }, end: "\\besac\\b", endCaptures: { 0: { name: "keyword.control.esac.shell" } }, name: "meta.case.shell", patterns: [{ include: "#comment" }, { captures: { 1: { name: "keyword.operator.pattern.case.default.shell" } }, match: "(?:[ \\t]*+)(\\* *\\))" }, { begin: "(?<!\\))(?!(?:[ \\t]*+)(?:esac\\b|$))", beginCaptures: {}, end: "(?:(?=\\besac\\b)|(\\)))", endCaptures: { 1: { name: "keyword.operator.pattern.case.shell" } }, name: "meta.case.entry.pattern.shell", patterns: [{ include: "#case_statement_context" }] }, { begin: "(?<=\\))", beginCaptures: {}, end: "(?:(;;)|(?=\\besac\\b))", endCaptures: { 1: { name: "punctuation.terminator.statement.case.shell" } }, name: "meta.case.entry.body.shell", patterns: [{ include: "#typical_statements" }, { include: "#initial_context" }] }] }, case_statement_context: { patterns: [{ match: "\\*", name: "variable.language.special.quantifier.star.shell keyword.operator.quantifier.star.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell" }, { match: "\\+", name: "variable.language.special.quantifier.plus.shell keyword.operator.quantifier.plus.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell" }, { match: "\\?", name: "variable.language.special.quantifier.question.shell keyword.operator.quantifier.question.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell" }, { match: "@", name: "variable.language.special.at.shell keyword.operator.at.shell punctuation.definition.regex.at.shell" }, { match: "\\|", name: "keyword.operator.orvariable.language.special.or.shell keyword.operator.alternation.ruby.shell punctuation.definition.regex.alternation.shell punctuation.separator.regex.alternation.shell" }, { match: "\\\\.", name: "constant.character.escape.shell" }, { match: "(?<=\\tin| in| |\\t|;;)\\(", name: "keyword.operator.pattern.case.shell" }, { begin: "(?<=\\S)(\\()", beginCaptures: { 1: { name: "punctuation.definition.group.shell punctuation.definition.regex.group.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.group.shell punctuation.definition.regex.group.shell" } }, name: "meta.parenthese.shell", patterns: [{ include: "#case_statement_context" }] }, { begin: "\\[", beginCaptures: { 0: { name: "punctuation.definition.character-class.shell" } }, end: "\\]", endCaptures: { 0: { name: "punctuation.definition.character-class.shell" } }, name: "string.regexp.character-class.shell", patterns: [{ match: "\\\\.", name: "constant.character.escape.shell" }] }, { include: "#string" }, { match: "[^) \\t\\n\\[?\\*\\|\\@]", name: "string.unquoted.pattern.shell string.regexp.unquoted.shell" }] }, command_name_range: { begin: "\\G", beginCaptures: {}, end: "(?:(?= |\\t|;|\\||&|$|\\n|\\)|\\`)|(?=<))", endCaptures: {}, name: "meta.statement.command.name.shell", patterns: [{ match: "(?<!\\w)(?:continue|return|break)(?!\\w)", name: "entity.name.function.call.shell entity.name.command.shell keyword.control.$0.shell" }, { match: "(?<!\\w)(?:(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|:|\\.)(?!\\/))(?!\\w)(?!-)", name: "entity.name.function.call.shell entity.name.command.shell support.function.builtin.shell" }, { include: "#variable" }, { captures: { 1: { name: "entity.name.function.call.shell entity.name.command.shell" } }, match: `(?:(?<!\\w)(?<=\\G|'|"|\\}|\\))([^ \\n\\t\\r"'=;&\\|\`){<>]+))` }, { begin: `(?:(?:\\G|(?<! |\\t|;|\\||&|\\n|\\{|#))(?:(\\$?)((?:(")|(')))))`, beginCaptures: { 1: { name: "meta.statement.command.name.quoted.shell punctuation.definition.string.shell entity.name.function.call.shell entity.name.command.shell" }, 2: {}, 3: { name: "meta.statement.command.name.quoted.shell string.quoted.double.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell" }, 4: { name: "meta.statement.command.name.quoted.shell string.quoted.single.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell" } }, end: "(?<!\\G)(?<=(?:\\2))", endCaptures: {}, patterns: [{ include: "#continuation_of_single_quoted_command_name" }, { include: "#continuation_of_double_quoted_command_name" }] }, { include: "#line_continuation" }, { include: "#simple_unquoted" }] }, command_statement: { begin: "(?:(?:[ \\t]*+)(?:(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!nocorrect |nocorrect\t|nocorrect$|readonly |readonly\t|readonly$|function |function\t|function$|foreach |foreach\t|foreach$|coproc |coproc\t|coproc$|logout |logout\t|logout$|export |export\t|export$|select |select\t|select$|repeat |repeat\t|repeat$|pushd |pushd\t|pushd$|until |until\t|until$|while |while\t|while$|local |local\t|local$|case |case\t|case$|done |done\t|done$|elif |elif\t|elif$|else |else\t|else$|esac |esac\t|esac$|popd |popd\t|popd$|then |then\t|then$|time |time\t|time$|for |for\t|for$|end |end\t|end$|fi |fi\t|fi$|do |do\t|do$|in |in\t|in$|if |if |if$)(?!\\\\\\n?$)))", beginCaptures: {}, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.statement.command.shell", patterns: [{ include: "#command_name_range" }, { include: "#line_continuation" }, { include: "#option" }, { include: "#argument" }, { include: "#string" }, { include: "#heredoc" }] }, comment: { captures: { 1: { name: "comment.line.number-sign.shell meta.shebang.shell" }, 2: { name: "punctuation.definition.comment.shebang.shell" }, 3: { name: "comment.line.number-sign.shell" }, 4: { name: "punctuation.definition.comment.shell" } }, match: "(?:(?:^|(?:[ \\t]++))(?:((?:(#!)(?:.*)))|((?:(#)(?:.*)))))" }, comments: { patterns: [{ include: "#block_comment" }, { include: "#line_comment" }] }, "compound-command": { patterns: [{ begin: "\\[", beginCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, end: "\\]", endCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, name: "meta.scope.logical-expression.shell", patterns: [{ include: "#logical-expression" }, { include: "#initial_context" }] }, { begin: "(?<=\\s|^){(?=\\s|$)", beginCaptures: { 0: { name: "punctuation.definition.group.shell" } }, end: "(?<=^|;)\\s*(})", endCaptures: { 1: { name: "punctuation.definition.group.shell" } }, name: "meta.scope.group.shell", patterns: [{ include: "#initial_context" }] }] }, continuation_of_double_quoted_command_name: { begin: '(?:\\G(?<="))', beginCaptures: {}, contentName: "meta.statement.command.name.continuation string.quoted.double entity.name.function.call entity.name.command", end: '"', endCaptures: { 0: { name: "string.quoted.double.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell" } }, patterns: [{ match: '\\\\[$\\n`"\\\\]', name: "constant.character.escape.shell" }, { include: "#variable" }, { include: "#interpolation" }] }, continuation_of_single_quoted_command_name: { begin: "(?:\\G(?<='))", beginCaptures: {}, contentName: "meta.statement.command.name.continuation string.quoted.single entity.name.function.call entity.name.command", end: "'", endCaptures: { 0: { name: "string.quoted.single.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell" } } }, custom_command_names: { patterns: [] }, custom_commands: { patterns: [] }, double_quote_context: { patterns: [{ match: '\\\\[$`"\\\\\\n]', name: "constant.character.escape.shell" }, { include: "#variable" }, { include: "#interpolation" }] }, double_quote_escape_char: { match: '\\\\[$`"\\\\\\n]', name: "constant.character.escape.shell" }, floating_keyword: { patterns: [{ match: "(?<=^|;|&| |\\t)(?:then|elif|else|done|end|do|if|fi)(?= |\\t|;|&|$)", name: "keyword.control.$0.shell" }] }, for_statement: { patterns: [{ begin: "(?:(\\bfor\\b)(?:(?:[ \\t]*+)((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:[ \\t]*+)(\\bin\\b)))", beginCaptures: { 1: { name: "keyword.control.for.shell" }, 2: { name: "variable.other.for.shell" }, 3: { name: "keyword.control.in.shell" } }, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.for.in.shell", patterns: [{ include: "#string" }, { include: "#simple_unquoted" }, { include: "#normal_context" }] }, { begin: "(\\bfor\\b)", beginCaptures: { 1: { name: "keyword.control.for.shell" } }, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.for.shell", patterns: [{ include: "#arithmetic_double" }, { include: "#normal_context" }] }] }, function_definition: { applyEndPatternLast: 1, begin: `(?:[ \\t]*+)(?:(?:(\\bfunction\\b)(?:[ \\t]*+)([^ \\t\\n\\r()="']+)(?:(?:(\\()(?:[ \\t]*+)(\\)))?))|(?:([^ \\t\\n\\r()="']+)(?:[ \\t]*+)(\\()(?:[ \\t]*+)(\\))))`, beginCaptures: { 1: { name: "storage.type.function.shell" }, 2: { name: "entity.name.function.shell" }, 3: { name: "punctuation.definition.arguments.shell" }, 4: { name: "punctuation.definition.arguments.shell" }, 5: { name: "entity.name.function.shell" }, 6: { name: "punctuation.definition.arguments.shell" }, 7: { name: "punctuation.definition.arguments.shell" } }, end: "(?<=\\}|\\))", endCaptures: {}, name: "meta.function.shell", patterns: [{ match: "(?:\\G(?:\\t| |\\n))" }, { begin: "\\{", beginCaptures: { 0: { name: "punctuation.definition.group.shell punctuation.section.function.definition.shell" } }, end: "\\}", endCaptures: { 0: { name: "punctuation.definition.group.shell punctuation.section.function.definition.shell" } }, name: "meta.function.body.shell", patterns: [{ include: "#initial_context" }] }, { begin: "\\(", beginCaptures: { 0: { name: "punctuation.definition.group.shell punctuation.section.function.definition.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.group.shell punctuation.section.function.definition.shell" } }, name: "meta.function.body.shell", patterns: [{ include: "#initial_context" }] }, { include: "#initial_context" }] }, heredoc: { patterns: [{ begin: `(?:((?<!<)(?:<<-))(?:[ \\t]*+)("|')(?:[ \\t]*+)([^"']+?)(?=\\s|;|&|<|"|')((?:\\2))(.*))`, beginCaptures: { 1: { name: "keyword.operator.heredoc.shell" }, 2: { name: "punctuation.definition.string.heredoc.quote.shell" }, 3: { name: "punctuation.definition.string.heredoc.delimiter.shell" }, 4: { name: "punctuation.definition.string.heredoc.quote.shell" }, 5: { patterns: [{ include: "#redirect_fix" }, { include: "#typical_statements" }] } }, contentName: "string.quoted.heredoc.indent.$3", end: "(?:(?:^\\t*)(?:\\3)(?=\\s|;|&|$))", endCaptures: { 0: { name: "punctuation.definition.string.heredoc.$0.shell" } }, patterns: [] }, { begin: `(?:((?<!<)(?:<<)(?!<))(?:[ \\t]*+)("|')(?:[ \\t]*+)([^"']+?)(?=\\s|;|&|<|"|')((?:\\2))(.*))`, beginCaptures: { 1: { name: "keyword.operator.heredoc.shell" }, 2: { name: "punctuation.definition.string.heredoc.quote.shell" }, 3: { name: "punctuation.definition.string.heredoc.delimiter.shell" }, 4: { name: "punctuation.definition.string.heredoc.quote.shell" }, 5: { patterns: [{ include: "#redirect_fix" }, { include: "#typical_statements" }] } }, contentName: "string.quoted.heredoc.no-indent.$3", end: "(?:^(?:\\3)(?=\\s|;|&|$))", endCaptures: { 0: { name: "punctuation.definition.string.heredoc.delimiter.shell" } }, patterns: [] }, { begin: `(?:((?<!<)(?:<<-))(?:[ \\t]*+)([^"' \\t]+)(?=\\s|;|&|<|"|')(.*))`, beginCaptures: { 1: { name: "keyword.operator.heredoc.shell" }, 2: { name: "punctuation.definition.string.heredoc.delimiter.shell" }, 3: { patterns: [{ include: "#redirect_fix" }, { include: "#typical_statements" }] } }, contentName: "string.unquoted.heredoc.indent.$2", end: "(?:(?:^\\t*)(?:\\2)(?=\\s|;|&|$))", endCaptures: { 0: { name: "punctuation.definition.string.heredoc.delimiter.shell" } }, patterns: [{ include: "#double_quote_escape_char" }, { include: "#variable" }, { include: "#interpolation" }] }, { begin: `(?:((?<!<)(?:<<)(?!<))(?:[ \\t]*+)([^"' \\t]+)(?=\\s|;|&|<|"|')(.*))`, beginCaptures: { 1: { name: "keyword.operator.heredoc.shell" }, 2: { name: "punctuation.definition.string.heredoc.delimiter.shell" }, 3: { patterns: [{ include: "#redirect_fix" }, { include: "#typical_statements" }] } }, contentName: "string.unquoted.heredoc.no-indent.$2", end: "(?:^(?:\\2)(?=\\s|;|&|$))", endCaptures: { 0: { name: "punctuation.definition.string.heredoc.delimiter.shell" } }, patterns: [{ include: "#double_quote_escape_char" }, { include: "#variable" }, { include: "#interpolation" }] }] }, herestring: { patterns: [{ begin: "(<<<)\\s*(('))", beginCaptures: { 1: { name: "keyword.operator.herestring.shell" }, 2: { name: "string.quoted.single.shell" }, 3: { name: "punctuation.definition.string.begin.shell" } }, contentName: "string.quoted.single.shell", end: "(')", endCaptures: { 0: { name: "string.quoted.single.shell" }, 1: { name: "punctuation.definition.string.end.shell" } }, name: "meta.herestring.shell" }, { begin: '(<<<)\\s*(("))', beginCaptures: { 1: { name: "keyword.operator.herestring.shell" }, 2: { name: "string.quoted.double.shell" }, 3: { name: "punctuation.definition.string.begin.shell" } }, contentName: "string.quoted.double.shell", end: '(")', endCaptures: { 0: { name: "string.quoted.double.shell" }, 1: { name: "punctuation.definition.string.end.shell" } }, name: "meta.herestring.shell", patterns: [{ include: "#double_quote_context" }] }, { captures: { 1: { name: "keyword.operator.herestring.shell" }, 2: { name: "string.unquoted.herestring.shell", patterns: [{ include: "#initial_context" }] } }, match: "(<<<)\\s*(([^\\s)\\\\]|\\\\.)+)", name: "meta.herestring.shell" }] }, initial_context: { patterns: [{ include: "#comment" }, { include: "#pipeline" }, { include: "#normal_statement_seperator" }, { include: "#logical_expression_double" }, { include: "#logical_expression_single" }, { include: "#assignment_statement" }, { include: "#case_statement" }, { include: "#for_statement" }, { include: "#loop" }, { include: "#function_definition" }, { include: "#line_continuation" }, { include: "#arithmetic_double" }, { include: "#misc_ranges" }, { include: "#variable" }, { include: "#interpolation" }, { include: "#heredoc" }, { include: "#herestring" }, { include: "#redirection" }, { include: "#pathname" }, { include: "#floating_keyword" }, { include: "#alias_statement" }, { include: "#normal_statement" }, { include: "#string" }, { include: "#support" }] }, inline_comment: { captures: { 1: { name: "comment.block.shell punctuation.definition.comment.begin.shell" }, 2: { name: "comment.block.shell" }, 3: { patterns: [{ match: "\\*\\/", name: "comment.block.shell punctuation.definition.comment.end.shell" }, { match: "\\*", name: "comment.block.shell" }] } }, match: "(\\/\\*)((?:(?:[^\\*]|(?:(?:\\*++)[^\\/]))*+)((?:(?:\\*++)\\/)))" }, interpolation: { patterns: [{ include: "#arithmetic_dollar" }, { include: "#subshell_dollar" }, { begin: "`", beginCaptures: { 0: { name: "punctuation.definition.evaluation.backticks.shell" } }, end: "`", endCaptures: { 0: { name: "punctuation.definition.evaluation.backticks.shell" } }, name: "string.interpolated.backtick.shell", patterns: [{ match: "\\\\[`\\\\$]", name: "constant.character.escape.shell" }, { begin: "(?<=\\W)(?=#)(?!#{)", beginCaptures: { 1: { name: "punctuation.whitespace.comment.leading.shell" } }, end: "(?!\\G)", patterns: [{ begin: "#", beginCaptures: { 0: { name: "punctuation.definition.comment.shell" } }, end: "(?=`)", name: "comment.line.number-sign.shell" }] }, { include: "#initial_context" }] }] }, keyword: { patterns: [{ match: "(?<=^|;|&|\\s)(then|else|elif|fi|for|in|do|done|select|continue|esac|while|until|return)(?=\\s|;|&|$)", name: "keyword.control.shell" }, { match: "(?<=^|;|&|\\s)(?:export|declare|typeset|local|readonly)(?=\\s|;|&|$)", name: "storage.modifier.shell" }] }, line_comment: { begin: "(?:\\s*+)(\\/\\/)", beginCaptures: { 1: { name: "punctuation.definition.comment.shell" } }, end: "(?<=\\n)(?<!\\\\\\n)", endCaptures: {}, name: "comment.line.double-slash.shell", patterns: [{ include: "#line_continuation_character" }] }, line_continuation: { match: "\\\\(?=\\n)", name: "constant.character.escape.line-continuation.shell" }, "logical-expression": { patterns: [{ include: "#arithmetic_no_dollar" }, { comment: "do we want a special rule for ( expr )?", match: "=[=~]?|!=?|<|>|&&|\\|\\|", name: "keyword.operator.logical.shell" }, { match: "(?<!\\S)-(nt|ot|ef|eq|ne|l[te]|g[te]|[a-hknoprstuwxzOGLSN])\\b", name: "keyword.operator.logical.shell" }] }, logical_expression_context: { patterns: [{ include: "#regex_comparison" }, { include: "#arithmetic_no_dollar" }, { include: "#logical-expression" }, { include: "#logical_expression_single" }, { include: "#logical_expression_double" }, { include: "#comment" }, { include: "#boolean" }, { include: "#redirect_number" }, { include: "#numeric_literal" }, { include: "#pipeline" }, { include: "#normal_statement_seperator" }, { include: "#string" }, { include: "#variable" }, { include: "#interpolation" }, { include: "#heredoc" }, { include: "#herestring" }, { include: "#pathname" }, { include: "#floating_keyword" }, { include: "#support" }] }, logical_expression_double: { begin: "\\[\\[", beginCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, end: "\\]\\]", endCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, name: "meta.scope.logical-expression.shell", patterns: [{ include: "#logical_expression_context" }] }, logical_expression_single: { begin: "\\[", beginCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, end: "\\]", endCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, name: "meta.scope.logical-expression.shell", patterns: [{ include: "#logical_expression_context" }] }, loop: { patterns: [{ begin: "(?<=^|;|&|\\s)(for)\\s+(.+?)\\s+(in)(?=\\s|;|&|$)", beginCaptures: { 1: { name: "keyword.control.shell" }, 2: { name: "variable.other.loop.shell", patterns: [{ include: "#string" }] }, 3: { name: "keyword.control.shell" } }, end: "(?<=^|;|&|\\s)done(?=\\s|;|&|$|\\))", endCaptures: { 0: { name: "keyword.control.shell" } }, name: "meta.scope.for-in-loop.shell", patterns: [{ include: "#initial_context" }] }, { begin: "(?<=^|;|&|\\s)(while|until)(?=\\s|;|&|$)", beginCaptures: { 1: { name: "keyword.control.shell" } }, end: "(?<=^|;|&|\\s)done(?=\\s|;|&|$|\\))", endCaptures: { 0: { name: "keyword.control.shell" } }, name: "meta.scope.while-loop.shell", patterns: [{ include: "#initial_context" }] }, { begin: "(?<=^|;|&|\\s)(select)\\s+((?:[^\\s\\\\]|\\\\.)+)(?=\\s|;|&|$)", beginCaptures: { 1: { name: "keyword.control.shell" }, 2: { name: "variable.other.loop.shell" } }, end: "(?<=^|;|&|\\s)(done)(?=\\s|;|&|$|\\))", endCaptures: { 1: { name: "keyword.control.shell" } }, name: "meta.scope.select-block.shell", patterns: [{ include: "#initial_context" }] }, { begin: "(?<=^|;|&|\\s)if(?=\\s|;|&|$)", beginCaptures: { 0: { name: "keyword.control.if.shell" } }, end: "(?<=^|;|&|\\s)fi(?=\\s|;|&|$)", endCaptures: { 0: { name: "keyword.control.fi.shell" } }, name: "meta.scope.if-block.shell", patterns: [{ include: "#initial_context" }] }] }, math: { patterns: [{ include: "#variable" }, { match: "\\+{1,2}|-{1,2}|!|~|\\*{1,2}|/|%|<[<=]?|>[>=]?|==|!=|^|\\|{1,2}|&{1,2}|\\?|:|,|=|[*/%+\\-&^|]=|<<=|>>=", name: "keyword.operator.arithmetic.shell" }, { match: "0[xX][0-9A-Fa-f]+", name: "constant.numeric.hex.shell" }, { match: ";", name: "punctuation.separator.semicolon.range" }, { match: "0\\d+", name: "constant.numeric.octal.shell" }, { match: "\\d{1,2}#[0-9a-zA-Z@_]+", name: "constant.numeric.other.shell" }, { match: "\\d+", name: "constant.numeric.integer.shell" }, { match: "(?<!\\w)(?:[a-zA-Z_0-9]+)(?!\\w)", name: "variable.other.normal.shell" }] }, math_operators: { patterns: [{ match: "\\+{1,2}|-{1,2}|!|~|\\*{1,2}|/|%|<[<=]?|>[>=]?|==|!=|^|\\|{1,2}|&{1,2}|\\?|:|,|=|[*/%+\\-&^|]=|<<=|>>=", name: "keyword.operator.arithmetic.shell" }, { match: "0[xX][0-9A-Fa-f]+", name: "constant.numeric.hex.shell" }, { match: "0\\d+", name: "constant.numeric.octal.shell" }, { match: "\\d{1,2}#[0-9a-zA-Z@_]+", name: "constant.numeric.other.shell" }, { match: "\\d+", name: "constant.numeric.integer.shell" }] }, misc_ranges: { patterns: [{ include: "#logical_expression_single" }, { include: "#logical_expression_double" }, { include: "#subshell_dollar" }, { begin: "(?<![^ \\t])({)(?!\\w|\\$)", beginCaptures: { 1: { name: "punctuation.definition.group.shell" } }, end: "}", endCaptures: { 0: { name: "punctuation.definition.group.shell" } }, name: "meta.scope.group.shell", patterns: [{ include: "#initial_context" }] }] }, modified_assignment_statement: { begin: "(?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$)", beginCaptures: { 0: { name: "storage.modifier.$0.shell" } }, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.statement.shell meta.expression.assignment.modified.shell", patterns: [{ match: "(?<!\\w)-\\w+\\b", name: "string.unquoted.argument.shell constant.other.option.shell" }, { include: "#array_value" }, { captures: { 1: { name: "variable.other.assignment.shell" }, 2: { name: "punctuation.definition.array.access.shell" }, 3: { name: "variable.other.assignment.shell" }, 4: { name: "constant.numeric.shell constant.numeric.integer.shell" }, 5: { name: "punctuation.definition.array.access.shell" }, 6: { name: "keyword.operator.assignment.shell" }, 7: { name: "keyword.operator.assignment.compound.shell" }, 8: { name: "keyword.operator.assignment.compound.shell" }, 9: { name: "constant.numeric.shell constant.numeric.hex.shell" }, 10: { name: "constant.numeric.shell constant.numeric.octal.shell" }, 11: { name: "constant.numeric.shell constant.numeric.other.shell" }, 12: { name: "constant.numeric.shell constant.numeric.decimal.shell" }, 13: { name: "constant.numeric.shell constant.numeric.version.shell" }, 14: { name: "constant.numeric.shell constant.numeric.integer.shell" } }, match: "(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:(?:(\\[)((?:(?:(?:(?:\\$?)(?:(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))|@)|\\*)|(-?\\d+)))(\\]))?)(?:(?:(?:(=)|(\\+=))|(-=))?)(?:(?:(?<==| |\\t|^|\\{|\\(|\\[)(?:(?:(?:(?:(?:(0[xX][0-9A-Fa-f]+)|(0\\d+))|(\\d{1,2}#[0-9a-zA-Z@_]+))|(-?\\d+(?:\\.\\d+)))|(-?\\d+(?:\\.\\d+)+))|(-?\\d+))(?= |\\t|$|\\}|\\)|;))?))" }, { include: "#normal_context" }] }, modifiers: { match: "(?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$)", name: "storage.modifier.$0.shell" }, normal_assignment_statement: { begin: "(?:[ \\t]*+)(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:(?:(\\[)((?:(?:(?:(?:\\$?)(?:(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))|@)|\\*)|(-?\\d+)))(\\]))?))(?:(?:(=)|(\\+=))|(-=))", beginCaptures: { 1: { name: "variable.other.assignment.shell" }, 2: { name: "punctuation.definition.array.access.shell" }, 3: { name: "variable.other.assignment.shell" }, 4: { name: "constant.numeric.shell constant.numeric.integer.shell" }, 5: { name: "punctuation.definition.array.access.shell" }, 6: { name: "keyword.operator.assignment.shell" }, 7: { name: "keyword.operator.assignment.compound.shell" }, 8: { name: "keyword.operator.assignment.compound.shell" } }, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.expression.assignment.shell", patterns: [{ include: "#comment" }, { include: "#string" }, { include: "#normal_assignment_statement" }, { begin: "(?<= |\\t)(?! |\\t|\\w+=)", beginCaptures: {}, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.statement.command.env.shell", patterns: [{ include: "#command_name_range" }, { include: "#line_continuation" }, { include: "#option" }, { include: "#argument" }, { include: "#string" }] }, { include: "#simple_unquoted" }, { include: "#normal_context" }] }, normal_context: { patterns: [{ include: "#comment" }, { include: "#pipeline" }, { include: "#normal_statement_seperator" }, { include: "#misc_ranges" }, { include: "#boolean" }, { include: "#redirect_number" }, { include: "#numeric_literal" }, { include: "#string" }, { include: "#variable" }, { include: "#interpolation" }, { include: "#heredoc" }, { include: "#herestring" }, { include: "#redirection" }, { include: "#pathname" }, { include: "#floating_keyword" }, { include: "#support" }, { include: "#parenthese" }] }, normal_statement: { begin: "(?:(?!^[ \\t]*+$)(?:(?<=^until | until |\\tuntil |^while | while |\\twhile |^elif | elif |\\telif |^else | else |\\telse |^then | then |\\tthen |^do | do |\\tdo |^if | if |\\tif )|(?<=(?:^|;|\\||&|!|\\(|\\{|\\`)))(?:[ \\t]*+)(?!nocorrect\\W|nocorrect\\$|function\\W|function\\$|foreach\\W|foreach\\$|repeat\\W|repeat\\$|logout\\W|logout\\$|coproc\\W|coproc\\$|select\\W|select\\$|while\\W|while\\$|pushd\\W|pushd\\$|until\\W|until\\$|case\\W|case\\$|done\\W|done\\$|elif\\W|elif\\$|else\\W|else\\$|esac\\W|esac\\$|popd\\W|popd\\$|then\\W|then\\$|time\\W|time\\$|for\\W|for\\$|end\\W|end\\$|fi\\W|fi\\$|do\\W|do\\$|in\\W|in\\$|if\\W|if\\$))", beginCaptures: {}, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.statement.shell", patterns: [{ include: "#typical_statements" }] }, normal_statement_seperator: { captures: { 1: { name: "punctuation.terminator.statement.semicolon.shell" }, 2: { name: "punctuation.separator.statement.and.shell" }, 3: { name: "punctuation.separator.statement.or.shell" }, 4: { name: "punctuation.separator.statement.background.shell" } }, match: "(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))" }, numeric_literal: { captures: { 1: { name: "constant.numeric.shell constant.numeric.hex.shell" }, 2: { name: "constant.numeric.shell constant.numeric.octal.shell" }, 3: { name: "constant.numeric.shell constant.numeric.other.shell" }, 4: { name: "constant.numeric.shell constant.numeric.decimal.shell" }, 5: { name: "constant.numeric.shell constant.numeric.version.shell" }, 6: { name: "constant.numeric.shell constant.numeric.integer.shell" } }, match: "(?<==| |\\t|^|\\{|\\(|\\[)(?:(?:(?:(?:(?:(0[xX][0-9A-Fa-f]+)|(0\\d+))|(\\d{1,2}#[0-9a-zA-Z@_]+))|(-?\\d+(?:\\.\\d+)))|(-?\\d+(?:\\.\\d+)+))|(-?\\d+))(?= |\\t|$|\\}|\\)|;)" }, option: { begin: "(?:(?:[ \\t]++)(-)((?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))))", beginCaptures: { 1: { name: "string.unquoted.argument.shell constant.other.option.dash.shell" }, 2: { name: "string.unquoted.argument.shell constant.other.option.shell" } }, contentName: "string.unquoted.argument constant.other.option", end: "(?:(?=[ \\t])|(?:(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)))", endCaptures: {}, patterns: [{ include: "#option_context" }] }, option_context: { patterns: [{ include: "#misc_ranges" }, { include: "#string" }, { include: "#variable" }, { include: "#interpolation" }, { include: "#heredoc" }, { include: "#herestring" }, { include: "#redirection" }, { include: "#pathname" }, { include: "#floating_keyword" }, { include: "#support" }] }, parenthese: { patterns: [{ begin: "\\(", beginCaptures: { 0: { name: "punctuation.section.parenthese.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.section.parenthese.shell" } }, name: "meta.parenthese.group.shell", patterns: [{ include: "#initial_context" }] }] }, pathname: { patterns: [{ match: "(?<=\\s|:|=|^)~", name: "keyword.operator.tilde.shell" }, { match: "\\*|\\?", name: "keyword.operator.glob.shell" }, { begin: "([?*+@!])(\\()", beginCaptures: { 1: { name: "keyword.operator.extglob.shell" }, 2: { name: "punctuation.definition.extglob.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.extglob.shell" } }, name: "meta.structure.extglob.shell", patterns: [{ include: "#initial_context" }] }] }, pipeline: { patterns: [{ match: "(?<=^|;|&|\\s)(time)(?=\\s|;|&|$)", name: "keyword.other.shell" }, { match: "[|!]", name: "keyword.operator.pipe.shell" }] }, redirect_fix: { captures: { 1: { name: "keyword.operator.redirect.shell" }, 2: { name: "string.unquoted.argument.shell" } }, match: "(?:(>>?)(?:[ \\t]*+)([^ \\t\\n>&;<>()$`\\\\\"'<\\|]+))" }, redirect_number: { captures: { 1: { name: "keyword.operator.redirect.stdout.shell" }, 2: { name: "keyword.operator.redirect.stderr.shell" }, 3: { name: "keyword.operator.redirect.$3.shell" } }, match: "(?<=[ \\t])(?:(?:(1)|(2)|(\\d+))(?=>))" }, redirection: { patterns: [{ begin: "[><]\\(", beginCaptures: { 0: { name: "punctuation.definition.string.begin.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.string.end.shell" } }, name: "string.interpolated.process-substitution.shell", patterns: [{ include: "#initial_context" }] }, { match: "(?<![<>])(&>|\\d*>&\\d*|\\d*(>>|>|<)|\\d*<&|\\d*<>)(?![<>])", name: "keyword.operator.redirect.shell" }] }, regex_comparison: { match: "=~", name: "keyword.operator.logical.regex.shell" }, regexp: { patterns: [{ match: "(?:.+)" }] }, simple_options: { captures: { 0: { patterns: [{ captures: { 1: { name: "string.unquoted.argument.shell constant.other.option.dash.shell" }, 2: { name: "string.unquoted.argument.shell constant.other.option.shell" } }, match: "(?:[ \\t]++)(-)(\\w+)" }] } }, match: "(?:(?:[ \\t]++)-(?:\\w+))*" }, simple_unquoted: { match: "[^ \\t\\n>&;<>()$`\\\\\"'<\\|]", name: "string.unquoted.shell" }, special_expansion: { match: "!|:[-=?]?|\\*|@|##|#|%%|%|\\/", name: "keyword.operator.expansion.shell" }, start_of_command: { match: "(?:(?:[ \\t]*+)(?:(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!nocorrect |nocorrect\t|nocorrect$|readonly |readonly\t|readonly$|function |function\t|function$|foreach |foreach\t|foreach$|coproc |coproc\t|coproc$|logout |logout\t|logout$|export |export\t|export$|select |select\t|select$|repeat |repeat\t|repeat$|pushd |pushd\t|pushd$|until |until\t|until$|while |while\t|while$|local |local\t|local$|case |case\t|case$|done |done\t|done$|elif |elif\t|elif$|else |else\t|else$|esac |esac\t|esac$|popd |popd\t|popd$|then |then\t|then$|time |time\t|time$|for |for\t|for$|end |end\t|end$|fi |fi\t|fi$|do |do\t|do$|in |in\t|in$|if |if |if$)(?!\\\\\\n?$)))" }, string: { patterns: [{ match: "\\\\.", name: "constant.character.escape.shell" }, { begin: "'", beginCaptures: { 0: { name: "punctuation.definition.string.begin.shell" } }, end: "'", endCaptures: { 0: { name: "punctuation.definition.string.end.shell" } }, name: "string.quoted.single.shell" }, { begin: '\\$?"', beginCaptures: { 0: { name: "punctuation.definition.string.begin.shell" } }, end: '"', endCaptures: { 0: { name: "punctuation.definition.string.end.shell" } }, name: "string.quoted.double.shell", patterns: [{ match: '\\\\[$\\n`"\\\\]', name: "constant.character.escape.shell" }, { include: "#variable" }, { include: "#interpolation" }] }, { begin: "\\$'", beginCaptures: { 0: { name: "punctuation.definition.string.begin.shell" } }, end: "'", endCaptures: { 0: { name: "punctuation.definition.string.end.shell" } }, name: "string.quoted.single.dollar.shell", patterns: [{ match: "\\\\(?:a|b|e|f|n|r|t|v|\\\\|')", name: "constant.character.escape.ansi-c.shell" }, { match: '\\\\\\d{3}"', name: "constant.character.escape.octal.shell" }, { match: '\\\\x[0-9a-fA-F]{2}"', name: "constant.character.escape.hex.shell" }, { match: '\\\\c."', name: "constant.character.escape.control-char.shell" }] }] }, subshell_dollar: { patterns: [{ begin: "(?:\\$\\()", beginCaptures: { 0: { name: "punctuation.definition.subshell.single.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.subshell.single.shell" } }, name: "meta.scope.subshell", patterns: [{ include: "#parenthese" }, { include: "#initial_context" }] }] }, support: { patterns: [{ match: "(?<=^|;|&|\\s)(?::|\\.)(?=\\s|;|&|$)", name: "support.function.builtin.shell" }] }, typical_statements: { patterns: [{ include: "#assignment_statement" }, { include: "#case_statement" }, { include: "#for_statement" }, { include: "#while_statement" }, { include: "#function_definition" }, { include: "#command_statement" }, { include: "#line_continuation" }, { include: "#arithmetic_double" }, { include: "#normal_context" }] }, variable: { patterns: [{ captures: { 1: { name: "punctuation.definition.variable.shell variable.parameter.positional.all.shell" }, 2: { name: "variable.parameter.positional.all.shell" } }, match: "(?:(\\$)(\\@(?!\\w)))" }, { captures: { 1: { name: "punctuation.definition.variable.shell variable.parameter.positional.shell" }, 2: { name: "variable.parameter.positional.shell" } }, match: "(?:(\\$)(\\d(?!\\w)))" }, { captures: { 1: { name: "punctuation.definition.variable.shell variable.language.special.shell" }, 2: { name: "variable.language.special.shell" } }, match: "(?:(\\$)([-*#?$!0_](?!\\w)))" }, { begin: "(?:(\\$)(\\{)(?:[ \\t]*+)(?=\\d))", beginCaptures: { 1: { name: "punctuation.definition.variable.shell variable.parameter.positional.shell" }, 2: { name: "punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell variable.parameter.positional.shell" } }, contentName: "meta.parameter-expansion", end: "\\}", endCaptures: { 0: { name: "punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell variable.parameter.positional.shell" } }, patterns: [{ include: "#special_expansion" }, { include: "#array_access_inline" }, { match: "\\d+", name: "variable.parameter.positional.shell" }, { match: "(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w)", name: "variable.other.normal.shell" }, { include: "#variable" }, { include: "#string" }] }, { begin: "(?:(\\$)(\\{))", beginCaptures: { 1: { name: "punctuation.definition.variable.shell" }, 2: { name: "punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell" } }, contentName: "meta.parameter-expansion", end: "\\}", endCaptures: { 0: { name: "punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell" } }, patterns: [{ include: "#special_expansion" }, { include: "#array_access_inline" }, { match: "(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w)", name: "variable.other.normal.shell" }, { include: "#variable" }, { include: "#string" }] }, { captures: { 1: { name: "punctuation.definition.variable.shell variable.other.normal.shell" }, 2: { name: "variable.other.normal.shell" } }, match: "(?:(\\$)((?:\\w+)(?!\\w)))" }] }, while_statement: { patterns: [{ begin: "(\\bwhile\\b)", beginCaptures: { 1: { name: "keyword.control.while.shell" } }, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.while.shell", patterns: [{ include: "#line_continuation" }, { include: "#math_operators" }, { include: "#option" }, { include: "#simple_unquoted" }, { include: "#normal_context" }, { include: "#string" }] }] } };
|
|
82990
|
+
a384 = { alias_statement: { begin: "(?:(?:[ \\t]*+)(alias)(?:[ \\t]*+)((?:(?:((?<!\\w)-\\w+\\b)(?:[ \\t]*+))*))(?:(?:[ \\t]*+)(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:(?:(\\[)((?:(?:(?:(?:\\$?)(?:(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))|@)|\\*)|(-?\\d+)))(\\]))?))(?:(?:(=)|(\\+=))|(-=))))", beginCaptures: { 1: { name: "storage.type.alias.shell" }, 2: { patterns: [{ match: "(?<!\\w)-\\w+\\b", name: "string.unquoted.argument.shell constant.other.option.shell" }] }, 3: { name: "string.unquoted.argument.shell constant.other.option.shell" }, 4: { name: "variable.other.assignment.shell" }, 5: { name: "punctuation.definition.array.access.shell" }, 6: { name: "variable.other.assignment.shell" }, 7: { name: "constant.numeric.shell constant.numeric.integer.shell" }, 8: { name: "punctuation.definition.array.access.shell" }, 9: { name: "keyword.operator.assignment.shell" }, 10: { name: "keyword.operator.assignment.compound.shell" }, 11: { name: "keyword.operator.assignment.compound.shell" } }, end: "(?:(?= |\\t|$)|(?:(?:(?:(;)|(&&))|(\\|\\|))|(&)))", endCaptures: { 1: { name: "punctuation.terminator.statement.semicolon.shell" }, 2: { name: "punctuation.separator.statement.and.shell" }, 3: { name: "punctuation.separator.statement.or.shell" }, 4: { name: "punctuation.separator.statement.background.shell" } }, name: "meta.expression.assignment.alias.shell", patterns: [{ include: "#normal_context" }] }, argument: { begin: "(?:[ \\t]++)(?!(?:&|\\||\\(|\\[|#|\\n|$|;))", beginCaptures: {}, end: "(?= |\\t|;|\\||&|$|\\n|\\)|\\`)", endCaptures: {}, name: "meta.argument.shell", patterns: [{ include: "#argument_context" }, { include: "#line_continuation" }] }, argument_context: { patterns: [{ captures: { 1: { name: "string.unquoted.argument.shell", patterns: [{ match: "\\*", name: "variable.language.special.wildcard.shell" }, { include: "#variable" }, { include: "#numeric_literal" }, { captures: { 1: { name: "constant.language.$1.shell" } }, match: "(?<!\\w)(\\b(?:true|false)\\b)(?!\\w)" }] } }, match: "(?:[ \\t]*+)((?:[^ \\t\\n>&;<>()$`\\\\\"'<\\|]+)(?!>))" }, { include: "#normal_context" }] }, arithmetic_double: { patterns: [{ begin: "\\(\\(", beginCaptures: { 0: { name: "punctuation.section.arithmetic.double.shell" } }, end: "\\)(?:\\s*)\\)", endCaptures: { 0: { name: "punctuation.section.arithmetic.double.shell" } }, name: "meta.arithmetic.shell", patterns: [{ include: "#math" }, { include: "#string" }] }] }, arithmetic_no_dollar: { patterns: [{ begin: "\\(", beginCaptures: { 0: { name: "punctuation.section.arithmetic.single.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.section.arithmetic.single.shell" } }, name: "meta.arithmetic.shell", patterns: [{ include: "#math" }, { include: "#string" }] }] }, array_access_inline: { captures: { 1: { name: "punctuation.section.array.shell" }, 2: { patterns: [{ include: "#special_expansion" }, { include: "#string" }, { include: "#variable" }] }, 3: { name: "punctuation.section.array.shell" } }, match: "(?:(\\[)([^\\[\\]]+)(\\]))" }, array_value: { begin: "(?:[ \\t]*+)(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:(?:(\\[)((?:(?:(?:(?:\\$?)(?:(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))|@)|\\*)|(-?\\d+)))(\\]))?))(?:(?:(=)|(\\+=))|(-=))(?:[ \\t]*+)(\\()", beginCaptures: { 1: { name: "variable.other.assignment.shell" }, 2: { name: "punctuation.definition.array.access.shell" }, 3: { name: "variable.other.assignment.shell" }, 4: { name: "constant.numeric.shell constant.numeric.integer.shell" }, 5: { name: "punctuation.definition.array.access.shell" }, 6: { name: "keyword.operator.assignment.shell" }, 7: { name: "keyword.operator.assignment.compound.shell" }, 8: { name: "keyword.operator.assignment.compound.shell" }, 9: { name: "punctuation.definition.array.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.array.shell" } }, patterns: [{ include: "#comment" }, { captures: { 1: { name: "variable.other.assignment.array.shell entity.other.attribute-name.shell" }, 2: { name: "keyword.operator.assignment.shell punctuation.definition.assignment.shell" } }, match: "(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(=))" }, { captures: { 1: { name: "punctuation.definition.bracket.named-array.shell" }, 2: { name: "string.unquoted.shell entity.other.attribute-name.bracket.shell" }, 3: { name: "punctuation.definition.bracket.named-array.shell" }, 4: { name: "punctuation.definition.assignment.shell" } }, match: "(?:(\\[)(.+?)(\\])(=))" }, { include: "#normal_context" }, { include: "#simple_unquoted" }] }, assignment_statement: { patterns: [{ include: "#array_value" }, { include: "#modified_assignment_statement" }, { include: "#normal_assignment_statement" }] }, basic_command_name: { captures: { 1: { name: "storage.modifier.$1.shell" }, 2: { name: "entity.name.function.call.shell entity.name.command.shell", patterns: [{ match: "(?<!\\w)(?:continue|return|break)(?!\\w)", name: "keyword.control.$0.shell" }, { match: "(?<!\\w)(?:(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|:|\\.)(?!\\/))(?!\\w)(?!-)", name: "support.function.builtin.shell" }, { include: "#variable" }] } }, match: `(?:(?:(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!nocorrect |nocorrect |nocorrect$|readonly |readonly |readonly$|function |function |function$|foreach |foreach |foreach$|coproc |coproc |coproc$|logout |logout |logout$|export |export |export$|select |select |select$|repeat |repeat |repeat$|pushd |pushd |pushd$|until |until |until$|while |while |while$|local |local |local$|case |case |case$|done |done |done$|elif |elif |elif$|else |else |else$|esac |esac |esac$|popd |popd |popd$|then |then |then$|time |time |time$|for |for |for$|end |end |end$|fi |fi |fi$|do |do |do$|in |in |in$|if |if |if$))(?:((?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$))|((?!"|'|\\\\\\n?$)(?:[^!'"<> \\t\\n\\r]+?)))(?:(?= |\\t)|(?:(?=;|\\||&|\\n|\\)|\\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\))))`, name: "meta.statement.command.name.basic.shell" }, block_comment: { begin: "(?:(?:\\s*+)(\\/\\*))", beginCaptures: { 1: { name: "punctuation.definition.comment.begin.shell" } }, end: "\\*\\/", endCaptures: { 0: { name: "punctuation.definition.comment.end.shell" } }, name: "comment.block.shell" }, boolean: { match: "\\b(?:true|false)\\b", name: "constant.language.$0.shell" }, case_statement: { begin: "(?:(\\bcase\\b)(?:[ \\t]*+)(.+?)(?:[ \\t]*+)(\\bin\\b))", beginCaptures: { 1: { name: "keyword.control.case.shell" }, 2: { patterns: [{ include: "#initial_context" }] }, 3: { name: "keyword.control.in.shell" } }, end: "\\besac\\b", endCaptures: { 0: { name: "keyword.control.esac.shell" } }, name: "meta.case.shell", patterns: [{ include: "#comment" }, { captures: { 1: { name: "keyword.operator.pattern.case.default.shell" } }, match: "(?:[ \\t]*+)(\\* *\\))" }, { begin: "(?<!\\))(?!(?:[ \\t]*+)(?:esac\\b|$))", beginCaptures: {}, end: "(?:(?=\\besac\\b)|(\\)))", endCaptures: { 1: { name: "keyword.operator.pattern.case.shell" } }, name: "meta.case.entry.pattern.shell", patterns: [{ include: "#case_statement_context" }] }, { begin: "(?<=\\))", beginCaptures: {}, end: "(?:(;;)|(?=\\besac\\b))", endCaptures: { 1: { name: "punctuation.terminator.statement.case.shell" } }, name: "meta.case.entry.body.shell", patterns: [{ include: "#typical_statements" }, { include: "#initial_context" }] }] }, case_statement_context: { patterns: [{ match: "\\*", name: "variable.language.special.quantifier.star.shell keyword.operator.quantifier.star.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell" }, { match: "\\+", name: "variable.language.special.quantifier.plus.shell keyword.operator.quantifier.plus.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell" }, { match: "\\?", name: "variable.language.special.quantifier.question.shell keyword.operator.quantifier.question.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell" }, { match: "@", name: "variable.language.special.at.shell keyword.operator.at.shell punctuation.definition.regex.at.shell" }, { match: "\\|", name: "keyword.operator.orvariable.language.special.or.shell keyword.operator.alternation.ruby.shell punctuation.definition.regex.alternation.shell punctuation.separator.regex.alternation.shell" }, { match: "\\\\.", name: "constant.character.escape.shell" }, { match: "(?<=\\tin| in| |\\t|;;)\\(", name: "keyword.operator.pattern.case.shell" }, { begin: "(?<=\\S)(\\()", beginCaptures: { 1: { name: "punctuation.definition.group.shell punctuation.definition.regex.group.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.group.shell punctuation.definition.regex.group.shell" } }, name: "meta.parenthese.shell", patterns: [{ include: "#case_statement_context" }] }, { begin: "\\[", beginCaptures: { 0: { name: "punctuation.definition.character-class.shell" } }, end: "\\]", endCaptures: { 0: { name: "punctuation.definition.character-class.shell" } }, name: "string.regexp.character-class.shell", patterns: [{ match: "\\\\.", name: "constant.character.escape.shell" }] }, { include: "#string" }, { match: "[^) \\t\\n\\[?\\*\\|\\@]", name: "string.unquoted.pattern.shell string.regexp.unquoted.shell" }] }, command_name_range: { begin: "\\G", beginCaptures: {}, end: "(?:(?= |\\t|;|\\||&|$|\\n|\\)|\\`)|(?=<))", endCaptures: {}, name: "meta.statement.command.name.shell", patterns: [{ match: "(?<!\\w)(?:continue|return|break)(?!\\w)", name: "entity.name.function.call.shell entity.name.command.shell keyword.control.$0.shell" }, { match: "(?<!\\w)(?:(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|:|\\.)(?!\\/))(?!\\w)(?!-)", name: "entity.name.function.call.shell entity.name.command.shell support.function.builtin.shell" }, { include: "#variable" }, { captures: { 1: { name: "entity.name.function.call.shell entity.name.command.shell" } }, match: `(?:(?<!\\w)(?<=\\G|'|"|\\}|\\))([^ \\n\\t\\r"'=;&\\|\`){<>]+))` }, { begin: `(?:(?:\\G|(?<! |\\t|;|\\||&|\\n|\\{|#))(?:(\\$?)((?:(")|(')))))`, beginCaptures: { 1: { name: "meta.statement.command.name.quoted.shell punctuation.definition.string.shell entity.name.function.call.shell entity.name.command.shell" }, 2: {}, 3: { name: "meta.statement.command.name.quoted.shell string.quoted.double.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell" }, 4: { name: "meta.statement.command.name.quoted.shell string.quoted.single.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell" } }, end: "(?<!\\G)(?<=(?:\\2))", endCaptures: {}, patterns: [{ include: "#continuation_of_single_quoted_command_name" }, { include: "#continuation_of_double_quoted_command_name" }] }, { include: "#line_continuation" }, { include: "#simple_unquoted" }] }, command_statement: { begin: "(?:(?:[ \\t]*+)(?:(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!nocorrect |nocorrect\t|nocorrect$|readonly |readonly\t|readonly$|function |function\t|function$|foreach |foreach\t|foreach$|coproc |coproc\t|coproc$|logout |logout\t|logout$|export |export\t|export$|select |select\t|select$|repeat |repeat\t|repeat$|pushd |pushd\t|pushd$|until |until\t|until$|while |while\t|while$|local |local\t|local$|case |case\t|case$|done |done\t|done$|elif |elif\t|elif$|else |else\t|else$|esac |esac\t|esac$|popd |popd\t|popd$|then |then\t|then$|time |time\t|time$|for |for\t|for$|end |end\t|end$|fi |fi\t|fi$|do |do\t|do$|in |in\t|in$|if |if\t|if$)(?!\\\\\\n?$)))", beginCaptures: {}, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.statement.command.shell", patterns: [{ include: "#command_name_range" }, { include: "#line_continuation" }, { include: "#option" }, { include: "#argument" }, { include: "#string" }, { include: "#heredoc" }] }, comment: { captures: { 1: { name: "comment.line.number-sign.shell meta.shebang.shell" }, 2: { name: "punctuation.definition.comment.shebang.shell" }, 3: { name: "comment.line.number-sign.shell" }, 4: { name: "punctuation.definition.comment.shell" } }, match: "(?:(?:^|(?:[ \\t]++))(?:((?:(#!)(?:.*)))|((?:(#)(?:.*)))))" }, comments: { patterns: [{ include: "#block_comment" }, { include: "#line_comment" }] }, "compound-command": { patterns: [{ begin: "\\[", beginCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, end: "\\]", endCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, name: "meta.scope.logical-expression.shell", patterns: [{ include: "#logical-expression" }, { include: "#initial_context" }] }, { begin: "(?<=\\s|^){(?=\\s|$)", beginCaptures: { 0: { name: "punctuation.definition.group.shell" } }, end: "(?<=^|;)\\s*(})", endCaptures: { 1: { name: "punctuation.definition.group.shell" } }, name: "meta.scope.group.shell", patterns: [{ include: "#initial_context" }] }] }, continuation_of_double_quoted_command_name: { begin: '(?:\\G(?<="))', beginCaptures: {}, contentName: "meta.statement.command.name.continuation string.quoted.double entity.name.function.call entity.name.command", end: '"', endCaptures: { 0: { name: "string.quoted.double.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell" } }, patterns: [{ match: '\\\\[$\\n`"\\\\]', name: "constant.character.escape.shell" }, { include: "#variable" }, { include: "#interpolation" }] }, continuation_of_single_quoted_command_name: { begin: "(?:\\G(?<='))", beginCaptures: {}, contentName: "meta.statement.command.name.continuation string.quoted.single entity.name.function.call entity.name.command", end: "'", endCaptures: { 0: { name: "string.quoted.single.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell" } } }, custom_command_names: { patterns: [] }, custom_commands: { patterns: [] }, double_quote_context: { patterns: [{ match: '\\\\[$`"\\\\\\n]', name: "constant.character.escape.shell" }, { include: "#variable" }, { include: "#interpolation" }] }, double_quote_escape_char: { match: '\\\\[$`"\\\\\\n]', name: "constant.character.escape.shell" }, floating_keyword: { patterns: [{ match: "(?<=^|;|&| |\\t)(?:then|elif|else|done|end|do|if|fi)(?= |\\t|;|&|$)", name: "keyword.control.$0.shell" }] }, for_statement: { patterns: [{ begin: "(?:(\\bfor\\b)(?:(?:[ \\t]*+)((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:[ \\t]*+)(\\bin\\b)))", beginCaptures: { 1: { name: "keyword.control.for.shell" }, 2: { name: "variable.other.for.shell" }, 3: { name: "keyword.control.in.shell" } }, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.for.in.shell", patterns: [{ include: "#string" }, { include: "#simple_unquoted" }, { include: "#normal_context" }] }, { begin: "(\\bfor\\b)", beginCaptures: { 1: { name: "keyword.control.for.shell" } }, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.for.shell", patterns: [{ include: "#arithmetic_double" }, { include: "#normal_context" }] }] }, function_definition: { applyEndPatternLast: 1, begin: `(?:[ \\t]*+)(?:(?:(\\bfunction\\b)(?:[ \\t]*+)([^ \\t\\n\\r()="']+)(?:(?:(\\()(?:[ \\t]*+)(\\)))?))|(?:([^ \\t\\n\\r()="']+)(?:[ \\t]*+)(\\()(?:[ \\t]*+)(\\))))`, beginCaptures: { 1: { name: "storage.type.function.shell" }, 2: { name: "entity.name.function.shell" }, 3: { name: "punctuation.definition.arguments.shell" }, 4: { name: "punctuation.definition.arguments.shell" }, 5: { name: "entity.name.function.shell" }, 6: { name: "punctuation.definition.arguments.shell" }, 7: { name: "punctuation.definition.arguments.shell" } }, end: "(?<=\\}|\\))", endCaptures: {}, name: "meta.function.shell", patterns: [{ match: "(?:\\G(?:\\t| |\\n))" }, { begin: "\\{", beginCaptures: { 0: { name: "punctuation.definition.group.shell punctuation.section.function.definition.shell" } }, end: "\\}", endCaptures: { 0: { name: "punctuation.definition.group.shell punctuation.section.function.definition.shell" } }, name: "meta.function.body.shell", patterns: [{ include: "#initial_context" }] }, { begin: "\\(", beginCaptures: { 0: { name: "punctuation.definition.group.shell punctuation.section.function.definition.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.group.shell punctuation.section.function.definition.shell" } }, name: "meta.function.body.shell", patterns: [{ include: "#initial_context" }] }, { include: "#initial_context" }] }, heredoc: { patterns: [{ begin: `(?:((?<!<)(?:<<-))(?:[ \\t]*+)("|')(?:[ \\t]*+)([^"']+?)(?=\\s|;|&|<|"|')((?:\\2))(.*))`, beginCaptures: { 1: { name: "keyword.operator.heredoc.shell" }, 2: { name: "punctuation.definition.string.heredoc.quote.shell" }, 3: { name: "punctuation.definition.string.heredoc.delimiter.shell" }, 4: { name: "punctuation.definition.string.heredoc.quote.shell" }, 5: { patterns: [{ include: "#redirect_fix" }, { include: "#typical_statements" }] } }, contentName: "string.quoted.heredoc.indent.$3", end: "(?:(?:^\\t*)(?:\\3)(?=\\s|;|&|$))", endCaptures: { 0: { name: "punctuation.definition.string.heredoc.$0.shell" } }, patterns: [] }, { begin: `(?:((?<!<)(?:<<)(?!<))(?:[ \\t]*+)("|')(?:[ \\t]*+)([^"']+?)(?=\\s|;|&|<|"|')((?:\\2))(.*))`, beginCaptures: { 1: { name: "keyword.operator.heredoc.shell" }, 2: { name: "punctuation.definition.string.heredoc.quote.shell" }, 3: { name: "punctuation.definition.string.heredoc.delimiter.shell" }, 4: { name: "punctuation.definition.string.heredoc.quote.shell" }, 5: { patterns: [{ include: "#redirect_fix" }, { include: "#typical_statements" }] } }, contentName: "string.quoted.heredoc.no-indent.$3", end: "(?:^(?:\\3)(?=\\s|;|&|$))", endCaptures: { 0: { name: "punctuation.definition.string.heredoc.delimiter.shell" } }, patterns: [] }, { begin: `(?:((?<!<)(?:<<-))(?:[ \\t]*+)([^"' \\t]+)(?=\\s|;|&|<|"|')(.*))`, beginCaptures: { 1: { name: "keyword.operator.heredoc.shell" }, 2: { name: "punctuation.definition.string.heredoc.delimiter.shell" }, 3: { patterns: [{ include: "#redirect_fix" }, { include: "#typical_statements" }] } }, contentName: "string.unquoted.heredoc.indent.$2", end: "(?:(?:^\\t*)(?:\\2)(?=\\s|;|&|$))", endCaptures: { 0: { name: "punctuation.definition.string.heredoc.delimiter.shell" } }, patterns: [{ include: "#double_quote_escape_char" }, { include: "#variable" }, { include: "#interpolation" }] }, { begin: `(?:((?<!<)(?:<<)(?!<))(?:[ \\t]*+)([^"' \\t]+)(?=\\s|;|&|<|"|')(.*))`, beginCaptures: { 1: { name: "keyword.operator.heredoc.shell" }, 2: { name: "punctuation.definition.string.heredoc.delimiter.shell" }, 3: { patterns: [{ include: "#redirect_fix" }, { include: "#typical_statements" }] } }, contentName: "string.unquoted.heredoc.no-indent.$2", end: "(?:^(?:\\2)(?=\\s|;|&|$))", endCaptures: { 0: { name: "punctuation.definition.string.heredoc.delimiter.shell" } }, patterns: [{ include: "#double_quote_escape_char" }, { include: "#variable" }, { include: "#interpolation" }] }] }, herestring: { patterns: [{ begin: "(<<<)\\s*(('))", beginCaptures: { 1: { name: "keyword.operator.herestring.shell" }, 2: { name: "string.quoted.single.shell" }, 3: { name: "punctuation.definition.string.begin.shell" } }, contentName: "string.quoted.single.shell", end: "(')", endCaptures: { 0: { name: "string.quoted.single.shell" }, 1: { name: "punctuation.definition.string.end.shell" } }, name: "meta.herestring.shell" }, { begin: '(<<<)\\s*(("))', beginCaptures: { 1: { name: "keyword.operator.herestring.shell" }, 2: { name: "string.quoted.double.shell" }, 3: { name: "punctuation.definition.string.begin.shell" } }, contentName: "string.quoted.double.shell", end: '(")', endCaptures: { 0: { name: "string.quoted.double.shell" }, 1: { name: "punctuation.definition.string.end.shell" } }, name: "meta.herestring.shell", patterns: [{ include: "#double_quote_context" }] }, { captures: { 1: { name: "keyword.operator.herestring.shell" }, 2: { name: "string.unquoted.herestring.shell", patterns: [{ include: "#initial_context" }] } }, match: "(<<<)\\s*(([^\\s)\\\\]|\\\\.)+)", name: "meta.herestring.shell" }] }, initial_context: { patterns: [{ include: "#comment" }, { include: "#pipeline" }, { include: "#normal_statement_seperator" }, { include: "#logical_expression_double" }, { include: "#logical_expression_single" }, { include: "#assignment_statement" }, { include: "#case_statement" }, { include: "#for_statement" }, { include: "#loop" }, { include: "#function_definition" }, { include: "#line_continuation" }, { include: "#arithmetic_double" }, { include: "#misc_ranges" }, { include: "#variable" }, { include: "#interpolation" }, { include: "#heredoc" }, { include: "#herestring" }, { include: "#redirection" }, { include: "#pathname" }, { include: "#floating_keyword" }, { include: "#alias_statement" }, { include: "#normal_statement" }, { include: "#string" }, { include: "#support" }] }, inline_comment: { captures: { 1: { name: "comment.block.shell punctuation.definition.comment.begin.shell" }, 2: { name: "comment.block.shell" }, 3: { patterns: [{ match: "\\*\\/", name: "comment.block.shell punctuation.definition.comment.end.shell" }, { match: "\\*", name: "comment.block.shell" }] } }, match: "(\\/\\*)((?:(?:[^\\*]|(?:(?:\\*++)[^\\/]))*+)((?:(?:\\*++)\\/)))" }, interpolation: { patterns: [{ include: "#arithmetic_dollar" }, { include: "#subshell_dollar" }, { begin: "`", beginCaptures: { 0: { name: "punctuation.definition.evaluation.backticks.shell" } }, end: "`", endCaptures: { 0: { name: "punctuation.definition.evaluation.backticks.shell" } }, name: "string.interpolated.backtick.shell", patterns: [{ match: "\\\\[`\\\\$]", name: "constant.character.escape.shell" }, { begin: "(?<=\\W)(?=#)(?!#{)", beginCaptures: { 1: { name: "punctuation.whitespace.comment.leading.shell" } }, end: "(?!\\G)", patterns: [{ begin: "#", beginCaptures: { 0: { name: "punctuation.definition.comment.shell" } }, end: "(?=`)", name: "comment.line.number-sign.shell" }] }, { include: "#initial_context" }] }] }, keyword: { patterns: [{ match: "(?<=^|;|&|\\s)(then|else|elif|fi|for|in|do|done|select|continue|esac|while|until|return)(?=\\s|;|&|$)", name: "keyword.control.shell" }, { match: "(?<=^|;|&|\\s)(?:export|declare|typeset|local|readonly)(?=\\s|;|&|$)", name: "storage.modifier.shell" }] }, line_comment: { begin: "(?:\\s*+)(\\/\\/)", beginCaptures: { 1: { name: "punctuation.definition.comment.shell" } }, end: "(?<=\\n)(?<!\\\\\\n)", endCaptures: {}, name: "comment.line.double-slash.shell", patterns: [{ include: "#line_continuation_character" }] }, line_continuation: { match: "\\\\(?=\\n)", name: "constant.character.escape.line-continuation.shell" }, "logical-expression": { patterns: [{ include: "#arithmetic_no_dollar" }, { comment: "do we want a special rule for ( expr )?", match: "=[=~]?|!=?|<|>|&&|\\|\\|", name: "keyword.operator.logical.shell" }, { match: "(?<!\\S)-(nt|ot|ef|eq|ne|l[te]|g[te]|[a-hknoprstuwxzOGLSN])\\b", name: "keyword.operator.logical.shell" }] }, logical_expression_context: { patterns: [{ include: "#regex_comparison" }, { include: "#arithmetic_no_dollar" }, { include: "#logical-expression" }, { include: "#logical_expression_single" }, { include: "#logical_expression_double" }, { include: "#comment" }, { include: "#boolean" }, { include: "#redirect_number" }, { include: "#numeric_literal" }, { include: "#pipeline" }, { include: "#normal_statement_seperator" }, { include: "#string" }, { include: "#variable" }, { include: "#interpolation" }, { include: "#heredoc" }, { include: "#herestring" }, { include: "#pathname" }, { include: "#floating_keyword" }, { include: "#support" }] }, logical_expression_double: { begin: "\\[\\[", beginCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, end: "\\]\\]", endCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, name: "meta.scope.logical-expression.shell", patterns: [{ include: "#logical_expression_context" }] }, logical_expression_single: { begin: "\\[", beginCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, end: "\\]", endCaptures: { 0: { name: "punctuation.definition.logical-expression.shell" } }, name: "meta.scope.logical-expression.shell", patterns: [{ include: "#logical_expression_context" }] }, loop: { patterns: [{ begin: "(?<=^|;|&|\\s)(for)\\s+(.+?)\\s+(in)(?=\\s|;|&|$)", beginCaptures: { 1: { name: "keyword.control.shell" }, 2: { name: "variable.other.loop.shell", patterns: [{ include: "#string" }] }, 3: { name: "keyword.control.shell" } }, end: "(?<=^|;|&|\\s)done(?=\\s|;|&|$|\\))", endCaptures: { 0: { name: "keyword.control.shell" } }, name: "meta.scope.for-in-loop.shell", patterns: [{ include: "#initial_context" }] }, { begin: "(?<=^|;|&|\\s)(while|until)(?=\\s|;|&|$)", beginCaptures: { 1: { name: "keyword.control.shell" } }, end: "(?<=^|;|&|\\s)done(?=\\s|;|&|$|\\))", endCaptures: { 0: { name: "keyword.control.shell" } }, name: "meta.scope.while-loop.shell", patterns: [{ include: "#initial_context" }] }, { begin: "(?<=^|;|&|\\s)(select)\\s+((?:[^\\s\\\\]|\\\\.)+)(?=\\s|;|&|$)", beginCaptures: { 1: { name: "keyword.control.shell" }, 2: { name: "variable.other.loop.shell" } }, end: "(?<=^|;|&|\\s)(done)(?=\\s|;|&|$|\\))", endCaptures: { 1: { name: "keyword.control.shell" } }, name: "meta.scope.select-block.shell", patterns: [{ include: "#initial_context" }] }, { begin: "(?<=^|;|&|\\s)if(?=\\s|;|&|$)", beginCaptures: { 0: { name: "keyword.control.if.shell" } }, end: "(?<=^|;|&|\\s)fi(?=\\s|;|&|$)", endCaptures: { 0: { name: "keyword.control.fi.shell" } }, name: "meta.scope.if-block.shell", patterns: [{ include: "#initial_context" }] }] }, math: { patterns: [{ include: "#variable" }, { match: "\\+{1,2}|-{1,2}|!|~|\\*{1,2}|/|%|<[<=]?|>[>=]?|==|!=|^|\\|{1,2}|&{1,2}|\\?|:|,|=|[*/%+\\-&^|]=|<<=|>>=", name: "keyword.operator.arithmetic.shell" }, { match: "0[xX][0-9A-Fa-f]+", name: "constant.numeric.hex.shell" }, { match: ";", name: "punctuation.separator.semicolon.range" }, { match: "0\\d+", name: "constant.numeric.octal.shell" }, { match: "\\d{1,2}#[0-9a-zA-Z@_]+", name: "constant.numeric.other.shell" }, { match: "\\d+", name: "constant.numeric.integer.shell" }, { match: "(?<!\\w)(?:[a-zA-Z_0-9]+)(?!\\w)", name: "variable.other.normal.shell" }] }, math_operators: { patterns: [{ match: "\\+{1,2}|-{1,2}|!|~|\\*{1,2}|/|%|<[<=]?|>[>=]?|==|!=|^|\\|{1,2}|&{1,2}|\\?|:|,|=|[*/%+\\-&^|]=|<<=|>>=", name: "keyword.operator.arithmetic.shell" }, { match: "0[xX][0-9A-Fa-f]+", name: "constant.numeric.hex.shell" }, { match: "0\\d+", name: "constant.numeric.octal.shell" }, { match: "\\d{1,2}#[0-9a-zA-Z@_]+", name: "constant.numeric.other.shell" }, { match: "\\d+", name: "constant.numeric.integer.shell" }] }, misc_ranges: { patterns: [{ include: "#logical_expression_single" }, { include: "#logical_expression_double" }, { include: "#subshell_dollar" }, { begin: "(?<![^ \\t])({)(?!\\w|\\$)", beginCaptures: { 1: { name: "punctuation.definition.group.shell" } }, end: "}", endCaptures: { 0: { name: "punctuation.definition.group.shell" } }, name: "meta.scope.group.shell", patterns: [{ include: "#initial_context" }] }] }, modified_assignment_statement: { begin: "(?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$)", beginCaptures: { 0: { name: "storage.modifier.$0.shell" } }, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.statement.shell meta.expression.assignment.modified.shell", patterns: [{ match: "(?<!\\w)-\\w+\\b", name: "string.unquoted.argument.shell constant.other.option.shell" }, { include: "#array_value" }, { captures: { 1: { name: "variable.other.assignment.shell" }, 2: { name: "punctuation.definition.array.access.shell" }, 3: { name: "variable.other.assignment.shell" }, 4: { name: "constant.numeric.shell constant.numeric.integer.shell" }, 5: { name: "punctuation.definition.array.access.shell" }, 6: { name: "keyword.operator.assignment.shell" }, 7: { name: "keyword.operator.assignment.compound.shell" }, 8: { name: "keyword.operator.assignment.compound.shell" }, 9: { name: "constant.numeric.shell constant.numeric.hex.shell" }, 10: { name: "constant.numeric.shell constant.numeric.octal.shell" }, 11: { name: "constant.numeric.shell constant.numeric.other.shell" }, 12: { name: "constant.numeric.shell constant.numeric.decimal.shell" }, 13: { name: "constant.numeric.shell constant.numeric.version.shell" }, 14: { name: "constant.numeric.shell constant.numeric.integer.shell" } }, match: "(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:(?:(\\[)((?:(?:(?:(?:\\$?)(?:(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))|@)|\\*)|(-?\\d+)))(\\]))?)(?:(?:(?:(=)|(\\+=))|(-=))?)(?:(?:(?<==| |\\t|^|\\{|\\(|\\[)(?:(?:(?:(?:(?:(0[xX][0-9A-Fa-f]+)|(0\\d+))|(\\d{1,2}#[0-9a-zA-Z@_]+))|(-?\\d+(?:\\.\\d+)))|(-?\\d+(?:\\.\\d+)+))|(-?\\d+))(?= |\\t|$|\\}|\\)|;))?))" }, { include: "#normal_context" }] }, modifiers: { match: "(?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$)", name: "storage.modifier.$0.shell" }, normal_assignment_statement: { begin: "(?:[ \\t]*+)(?:((?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))(?:(?:(\\[)((?:(?:(?:(?:\\$?)(?:(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w))|@)|\\*)|(-?\\d+)))(\\]))?))(?:(?:(=)|(\\+=))|(-=))", beginCaptures: { 1: { name: "variable.other.assignment.shell" }, 2: { name: "punctuation.definition.array.access.shell" }, 3: { name: "variable.other.assignment.shell" }, 4: { name: "constant.numeric.shell constant.numeric.integer.shell" }, 5: { name: "punctuation.definition.array.access.shell" }, 6: { name: "keyword.operator.assignment.shell" }, 7: { name: "keyword.operator.assignment.compound.shell" }, 8: { name: "keyword.operator.assignment.compound.shell" } }, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.expression.assignment.shell", patterns: [{ include: "#comment" }, { include: "#string" }, { include: "#normal_assignment_statement" }, { begin: "(?<= |\\t)(?! |\\t|\\w+=)", beginCaptures: {}, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.statement.command.env.shell", patterns: [{ include: "#command_name_range" }, { include: "#line_continuation" }, { include: "#option" }, { include: "#argument" }, { include: "#string" }] }, { include: "#simple_unquoted" }, { include: "#normal_context" }] }, normal_context: { patterns: [{ include: "#comment" }, { include: "#pipeline" }, { include: "#normal_statement_seperator" }, { include: "#misc_ranges" }, { include: "#boolean" }, { include: "#redirect_number" }, { include: "#numeric_literal" }, { include: "#string" }, { include: "#variable" }, { include: "#interpolation" }, { include: "#heredoc" }, { include: "#herestring" }, { include: "#redirection" }, { include: "#pathname" }, { include: "#floating_keyword" }, { include: "#support" }, { include: "#parenthese" }] }, normal_statement: { begin: "(?:(?!^[ \\t]*+$)(?:(?<=^until | until |\\tuntil |^while | while |\\twhile |^elif | elif |\\telif |^else | else |\\telse |^then | then |\\tthen |^do | do |\\tdo |^if | if |\\tif )|(?<=(?:^|;|\\||&|!|\\(|\\{|\\`)))(?:[ \\t]*+)(?!nocorrect\\W|nocorrect\\$|function\\W|function\\$|foreach\\W|foreach\\$|repeat\\W|repeat\\$|logout\\W|logout\\$|coproc\\W|coproc\\$|select\\W|select\\$|while\\W|while\\$|pushd\\W|pushd\\$|until\\W|until\\$|case\\W|case\\$|done\\W|done\\$|elif\\W|elif\\$|else\\W|else\\$|esac\\W|esac\\$|popd\\W|popd\\$|then\\W|then\\$|time\\W|time\\$|for\\W|for\\$|end\\W|end\\$|fi\\W|fi\\$|do\\W|do\\$|in\\W|in\\$|if\\W|if\\$))", beginCaptures: {}, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.statement.shell", patterns: [{ include: "#typical_statements" }] }, normal_statement_seperator: { captures: { 1: { name: "punctuation.terminator.statement.semicolon.shell" }, 2: { name: "punctuation.separator.statement.and.shell" }, 3: { name: "punctuation.separator.statement.or.shell" }, 4: { name: "punctuation.separator.statement.background.shell" } }, match: "(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))" }, numeric_literal: { captures: { 1: { name: "constant.numeric.shell constant.numeric.hex.shell" }, 2: { name: "constant.numeric.shell constant.numeric.octal.shell" }, 3: { name: "constant.numeric.shell constant.numeric.other.shell" }, 4: { name: "constant.numeric.shell constant.numeric.decimal.shell" }, 5: { name: "constant.numeric.shell constant.numeric.version.shell" }, 6: { name: "constant.numeric.shell constant.numeric.integer.shell" } }, match: "(?<==| |\\t|^|\\{|\\(|\\[)(?:(?:(?:(?:(?:(0[xX][0-9A-Fa-f]+)|(0\\d+))|(\\d{1,2}#[0-9a-zA-Z@_]+))|(-?\\d+(?:\\.\\d+)))|(-?\\d+(?:\\.\\d+)+))|(-?\\d+))(?= |\\t|$|\\}|\\)|;)" }, option: { begin: "(?:(?:[ \\t]++)(-)((?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))))", beginCaptures: { 1: { name: "string.unquoted.argument.shell constant.other.option.dash.shell" }, 2: { name: "string.unquoted.argument.shell constant.other.option.shell" } }, contentName: "string.unquoted.argument constant.other.option", end: "(?:(?=[ \\t])|(?:(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)))", endCaptures: {}, patterns: [{ include: "#option_context" }] }, option_context: { patterns: [{ include: "#misc_ranges" }, { include: "#string" }, { include: "#variable" }, { include: "#interpolation" }, { include: "#heredoc" }, { include: "#herestring" }, { include: "#redirection" }, { include: "#pathname" }, { include: "#floating_keyword" }, { include: "#support" }] }, parenthese: { patterns: [{ begin: "\\(", beginCaptures: { 0: { name: "punctuation.section.parenthese.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.section.parenthese.shell" } }, name: "meta.parenthese.group.shell", patterns: [{ include: "#initial_context" }] }] }, pathname: { patterns: [{ match: "(?<=\\s|:|=|^)~", name: "keyword.operator.tilde.shell" }, { match: "\\*|\\?", name: "keyword.operator.glob.shell" }, { begin: "([?*+@!])(\\()", beginCaptures: { 1: { name: "keyword.operator.extglob.shell" }, 2: { name: "punctuation.definition.extglob.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.extglob.shell" } }, name: "meta.structure.extglob.shell", patterns: [{ include: "#initial_context" }] }] }, pipeline: { patterns: [{ match: "(?<=^|;|&|\\s)(time)(?=\\s|;|&|$)", name: "keyword.other.shell" }, { match: "[|!]", name: "keyword.operator.pipe.shell" }] }, redirect_fix: { captures: { 1: { name: "keyword.operator.redirect.shell" }, 2: { name: "string.unquoted.argument.shell" } }, match: "(?:(>>?)(?:[ \\t]*+)([^ \\t\\n>&;<>()$`\\\\\"'<\\|]+))" }, redirect_number: { captures: { 1: { name: "keyword.operator.redirect.stdout.shell" }, 2: { name: "keyword.operator.redirect.stderr.shell" }, 3: { name: "keyword.operator.redirect.$3.shell" } }, match: "(?<=[ \\t])(?:(?:(1)|(2)|(\\d+))(?=>))" }, redirection: { patterns: [{ begin: "[><]\\(", beginCaptures: { 0: { name: "punctuation.definition.string.begin.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.string.end.shell" } }, name: "string.interpolated.process-substitution.shell", patterns: [{ include: "#initial_context" }] }, { match: "(?<![<>])(&>|\\d*>&\\d*|\\d*(>>|>|<)|\\d*<&|\\d*<>)(?![<>])", name: "keyword.operator.redirect.shell" }] }, regex_comparison: { match: "=~", name: "keyword.operator.logical.regex.shell" }, regexp: { patterns: [{ match: "(?:.+)" }] }, simple_options: { captures: { 0: { patterns: [{ captures: { 1: { name: "string.unquoted.argument.shell constant.other.option.dash.shell" }, 2: { name: "string.unquoted.argument.shell constant.other.option.shell" } }, match: "(?:[ \\t]++)(-)(\\w+)" }] } }, match: "(?:(?:[ \\t]++)-(?:\\w+))*" }, simple_unquoted: { match: "[^ \\t\\n>&;<>()$`\\\\\"'<\\|]", name: "string.unquoted.shell" }, special_expansion: { match: "!|:[-=?]?|\\*|@|##|#|%%|%|\\/", name: "keyword.operator.expansion.shell" }, start_of_command: { match: "(?:(?:[ \\t]*+)(?:(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!nocorrect |nocorrect\t|nocorrect$|readonly |readonly\t|readonly$|function |function\t|function$|foreach |foreach\t|foreach$|coproc |coproc\t|coproc$|logout |logout\t|logout$|export |export\t|export$|select |select\t|select$|repeat |repeat\t|repeat$|pushd |pushd\t|pushd$|until |until\t|until$|while |while\t|while$|local |local\t|local$|case |case\t|case$|done |done\t|done$|elif |elif\t|elif$|else |else\t|else$|esac |esac\t|esac$|popd |popd\t|popd$|then |then\t|then$|time |time\t|time$|for |for\t|for$|end |end\t|end$|fi |fi\t|fi$|do |do\t|do$|in |in\t|in$|if |if\t|if$)(?!\\\\\\n?$)))" }, string: { patterns: [{ match: "\\\\.", name: "constant.character.escape.shell" }, { begin: "'", beginCaptures: { 0: { name: "punctuation.definition.string.begin.shell" } }, end: "'", endCaptures: { 0: { name: "punctuation.definition.string.end.shell" } }, name: "string.quoted.single.shell" }, { begin: '\\$?"', beginCaptures: { 0: { name: "punctuation.definition.string.begin.shell" } }, end: '"', endCaptures: { 0: { name: "punctuation.definition.string.end.shell" } }, name: "string.quoted.double.shell", patterns: [{ match: '\\\\[$\\n`"\\\\]', name: "constant.character.escape.shell" }, { include: "#variable" }, { include: "#interpolation" }] }, { begin: "\\$'", beginCaptures: { 0: { name: "punctuation.definition.string.begin.shell" } }, end: "'", endCaptures: { 0: { name: "punctuation.definition.string.end.shell" } }, name: "string.quoted.single.dollar.shell", patterns: [{ match: "\\\\(?:a|b|e|f|n|r|t|v|\\\\|')", name: "constant.character.escape.ansi-c.shell" }, { match: '\\\\\\d{3}"', name: "constant.character.escape.octal.shell" }, { match: '\\\\x[0-9a-fA-F]{2}"', name: "constant.character.escape.hex.shell" }, { match: '\\\\c."', name: "constant.character.escape.control-char.shell" }] }] }, subshell_dollar: { patterns: [{ begin: "(?:\\$\\()", beginCaptures: { 0: { name: "punctuation.definition.subshell.single.shell" } }, end: "\\)", endCaptures: { 0: { name: "punctuation.definition.subshell.single.shell" } }, name: "meta.scope.subshell", patterns: [{ include: "#parenthese" }, { include: "#initial_context" }] }] }, support: { patterns: [{ match: "(?<=^|;|&|\\s)(?::|\\.)(?=\\s|;|&|$)", name: "support.function.builtin.shell" }] }, typical_statements: { patterns: [{ include: "#assignment_statement" }, { include: "#case_statement" }, { include: "#for_statement" }, { include: "#while_statement" }, { include: "#function_definition" }, { include: "#command_statement" }, { include: "#line_continuation" }, { include: "#arithmetic_double" }, { include: "#normal_context" }] }, variable: { patterns: [{ captures: { 1: { name: "punctuation.definition.variable.shell variable.parameter.positional.all.shell" }, 2: { name: "variable.parameter.positional.all.shell" } }, match: "(?:(\\$)(\\@(?!\\w)))" }, { captures: { 1: { name: "punctuation.definition.variable.shell variable.parameter.positional.shell" }, 2: { name: "variable.parameter.positional.shell" } }, match: "(?:(\\$)(\\d(?!\\w)))" }, { captures: { 1: { name: "punctuation.definition.variable.shell variable.language.special.shell" }, 2: { name: "variable.language.special.shell" } }, match: "(?:(\\$)([-*#?$!0_](?!\\w)))" }, { begin: "(?:(\\$)(\\{)(?:[ \\t]*+)(?=\\d))", beginCaptures: { 1: { name: "punctuation.definition.variable.shell variable.parameter.positional.shell" }, 2: { name: "punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell variable.parameter.positional.shell" } }, contentName: "meta.parameter-expansion", end: "\\}", endCaptures: { 0: { name: "punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell variable.parameter.positional.shell" } }, patterns: [{ include: "#special_expansion" }, { include: "#array_access_inline" }, { match: "\\d+", name: "variable.parameter.positional.shell" }, { match: "(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w)", name: "variable.other.normal.shell" }, { include: "#variable" }, { include: "#string" }] }, { begin: "(?:(\\$)(\\{))", beginCaptures: { 1: { name: "punctuation.definition.variable.shell" }, 2: { name: "punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell" } }, contentName: "meta.parameter-expansion", end: "\\}", endCaptures: { 0: { name: "punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell" } }, patterns: [{ include: "#special_expansion" }, { include: "#array_access_inline" }, { match: "(?<!\\w)(?:[a-zA-Z_0-9-]+)(?!\\w)", name: "variable.other.normal.shell" }, { include: "#variable" }, { include: "#string" }] }, { captures: { 1: { name: "punctuation.definition.variable.shell variable.other.normal.shell" }, 2: { name: "variable.other.normal.shell" } }, match: "(?:(\\$)((?:\\w+)(?!\\w)))" }] }, while_statement: { patterns: [{ begin: "(\\bwhile\\b)", beginCaptures: { 1: { name: "keyword.control.while.shell" } }, end: "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", endCaptures: {}, name: "meta.while.shell", patterns: [{ include: "#line_continuation" }, { include: "#math_operators" }, { include: "#option" }, { include: "#simple_unquoted" }, { include: "#normal_context" }, { include: "#string" }] }] } };
|
|
82991
82991
|
l43 = { displayName: e409, name: n393, patterns: t404, repository: a384, scopeName: i270 };
|
|
82992
82992
|
});
|
|
82993
82993
|
var exports_shellsession2 = {};
|
|
@@ -155973,7 +155973,7 @@ function Ce2(e488) {
|
|
|
155973
155973
|
var t481, r325 = e488.properties;
|
|
155974
155974
|
return import_react5.default.createElement("ul", { className: me2 }, (t481 = Te2(r325)) === null || t481 === undefined ? undefined : t481.map(function(e489, t482) {
|
|
155975
155975
|
var r326, a443 = e489.name, o237 = e489.type, i314 = Fe2(e489), l52 = ((r326 = e489.ofProperty) === null || r326 === undefined ? undefined : r326.description) || e489.description || "", c105 = Ie2(e489.meta);
|
|
155976
|
-
return import_react5.default.createElement("atlas-apiref-prop", { className: ve2, key: t482 }, a443 || o237 ? import_react5.default.createElement("dl", { className: fe2 }, import_react5.default.createElement(Oe2, { property: e489, meta: e489.meta || [] }), import_react5.default.createElement(_e2, { property: e489 }), import_react5.default.createElement(
|
|
155976
|
+
return import_react5.default.createElement("atlas-apiref-prop", { className: ve2, key: t482 }, a443 || o237 ? import_react5.default.createElement("dl", { className: fe2 }, import_react5.default.createElement(Oe2, { property: e489, meta: e489.meta || [] }), import_react5.default.createElement(_e2, { property: e489 }), import_react5.default.createElement(Ae2, { metas: e489.meta || [] })) : null, l52 || c105 ? import_react5.default.createElement("atlas-apiref-propdescription", { className: pe2 }, import_react5.default.createElement(import_react5.default.Fragment, null, import_react5.default.createElement("div", null, l52), import_react5.default.createElement("div", null, Ie2(e489.meta)))) : null, (i314 == null ? undefined : i314.length) > 0 ? import_react5.default.createElement(Re2, { parent: e489, properties: i314 }) : null);
|
|
155977
155977
|
}));
|
|
155978
155978
|
}
|
|
155979
155979
|
function Oe2(e488) {
|
|
@@ -156022,7 +156022,7 @@ function Pe2(e488) {
|
|
|
156022
156022
|
}
|
|
156023
156023
|
return import_react5.default.createElement("atlas-apiref-propmeta", { "data-name": e488.name, "data-value": e488.value }, import_react5.default.createElement("dd", null, import_react5.default.createElement("code", null, e488.href ? import_react5.default.createElement("a", { href: e488.href }, t481) : t481)));
|
|
156024
156024
|
}
|
|
156025
|
-
function
|
|
156025
|
+
function Ae2(e488) {
|
|
156026
156026
|
var t481 = e488.metas, r325 = { deprecated: 0, required: 1, defaults: 2 }, a443 = b4(t481).sort(function(e489, n470) {
|
|
156027
156027
|
var t482, a444;
|
|
156028
156028
|
return ((t482 = r325[e489.name]) !== null && t482 !== undefined ? t482 : 3) - ((a444 = r325[n470.name]) !== null && a444 !== undefined ? a444 : 3);
|
|
@@ -156031,7 +156031,7 @@ function Re2(e488) {
|
|
|
156031
156031
|
return import_react5.default.createElement(Pe2, m41({ key: t482 }, e489));
|
|
156032
156032
|
}));
|
|
156033
156033
|
}
|
|
156034
|
-
function
|
|
156034
|
+
function Re2(e488) {
|
|
156035
156035
|
var r325, a443 = e488.parent, o237 = e488.properties, i314 = import_react5.useState(false), l52 = g3(i314, 2), c105 = l52[0], u28 = l52[1], s187 = Te2(o237 || []), d29 = Le2(a443), m82 = function() {
|
|
156036
156036
|
var e489;
|
|
156037
156037
|
return ((a443 == null ? undefined : a443.type) !== DEFINED_DEFINITION_PROPERTY_TYPE.ARRAY || ((e489 = a443 == null ? undefined : a443.ofProperty) === null || e489 === undefined ? undefined : e489.type) !== DEFINED_DEFINITION_PROPERTY_TYPE.ENUM) && (a443 == null ? undefined : a443.type) !== DEFINED_DEFINITION_PROPERTY_TYPE.ENUM && s187.every(function(e490) {
|
|
@@ -156048,7 +156048,7 @@ function Ae2(e488) {
|
|
|
156048
156048
|
return u28(!c105);
|
|
156049
156049
|
}, isExpanded: c105 }) : null, import_react5.default.createElement("div", { className: "".concat(Ee2, " ").concat(c105 && be2) }, import_react5.default.createElement("div", { className: ke2 }, import_react5.default.createElement("ul", { role: "list", className: xe2 }, s187 == null ? undefined : s187.map(function(e489, t481) {
|
|
156050
156050
|
var r326, a444 = e489.name, o238 = e489.type, i315 = Fe2(e489), l53 = ((r326 = e489.ofProperty) === null || r326 === undefined ? undefined : r326.description) || e489.description || "", c106 = Ie2(e489.meta);
|
|
156051
|
-
return import_react5.default.createElement("atlas-apiref-prop", { className: we2, key: t481 }, a444 || o238 ? import_react5.default.createElement("dl", { className: fe2 }, import_react5.default.createElement(Oe2, { property: e489, meta: e489.meta || [], parentChoiceType: d29 || !!v4 }), import_react5.default.createElement(_e2, { property: e489 }), import_react5.default.createElement(
|
|
156051
|
+
return import_react5.default.createElement("atlas-apiref-prop", { className: we2, key: t481 }, a444 || o238 ? import_react5.default.createElement("dl", { className: fe2 }, import_react5.default.createElement(Oe2, { property: e489, meta: e489.meta || [], parentChoiceType: d29 || !!v4 }), import_react5.default.createElement(_e2, { property: e489 }), import_react5.default.createElement(Ae2, { metas: e489.meta || [] })) : null, l53 || c106 ? import_react5.default.createElement("atlas-apiref-propdescription", { className: pe2 }, import_react5.default.createElement(import_react5.default.Fragment, null, import_react5.default.createElement("div", null, l53), import_react5.default.createElement("div", null, Ie2(e489.meta)))) : null, (i315 == null ? undefined : i315.length) ? import_react5.default.createElement(Re2, { parent: e489, properties: i315 }) : null);
|
|
156052
156052
|
})))));
|
|
156053
156053
|
}
|
|
156054
156054
|
function Be2(e488) {
|
|
@@ -156125,20 +156125,20 @@ function Me2(e488) {
|
|
|
156125
156125
|
} finally {
|
|
156126
156126
|
j4.f();
|
|
156127
156127
|
}
|
|
156128
|
-
var _8, P4 = false,
|
|
156128
|
+
var _8, P4 = false, A8 = h3(N6);
|
|
156129
156129
|
try {
|
|
156130
|
-
for (
|
|
156131
|
-
var
|
|
156132
|
-
if (
|
|
156130
|
+
for (A8.s();!(_8 = A8.n()).done; ) {
|
|
156131
|
+
var R8 = _8.value;
|
|
156132
|
+
if (R8.trim() === "or") {
|
|
156133
156133
|
P4 = true;
|
|
156134
156134
|
break;
|
|
156135
156135
|
}
|
|
156136
|
-
w4[
|
|
156136
|
+
w4[R8] = true;
|
|
156137
156137
|
}
|
|
156138
156138
|
} catch (e489) {
|
|
156139
|
-
|
|
156139
|
+
A8.e(e489);
|
|
156140
156140
|
} finally {
|
|
156141
|
-
|
|
156141
|
+
A8.f();
|
|
156142
156142
|
}
|
|
156143
156143
|
return P4 || (N6 = Object.keys(w4)), [N6.join(" or ")];
|
|
156144
156144
|
}
|
|
@@ -156416,7 +156416,7 @@ var un = (an || (an = 1, on.exports = (rn || (rn = 1, function() {
|
|
|
156416
156416
|
}
|
|
156417
156417
|
function i314() {
|
|
156418
156418
|
var n470 = e488(this.type);
|
|
156419
|
-
return
|
|
156419
|
+
return A8[n470] || (A8[n470] = true, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), (n470 = this.props.ref) !== undefined ? n470 : null;
|
|
156420
156420
|
}
|
|
156421
156421
|
function l52(n470, t482, a444, o238, l53, u29) {
|
|
156422
156422
|
var d30, v5 = t482.children;
|
|
@@ -156472,15 +156472,15 @@ React keys must be passed directly to JSX without using spread:
|
|
|
156472
156472
|
}
|
|
156473
156473
|
var s187, d29 = import_react5.default, m82 = Symbol.for("react.transitional.element"), v4 = Symbol.for("react.portal"), p28 = Symbol.for("react.fragment"), f4 = Symbol.for("react.strict_mode"), h6 = Symbol.for("react.profiler"), g6 = Symbol.for("react.consumer"), y4 = Symbol.for("react.context"), E8 = Symbol.for("react.forward_ref"), b8 = Symbol.for("react.suspense"), x4 = Symbol.for("react.suspense_list"), w4 = Symbol.for("react.memo"), N6 = Symbol.for("react.lazy"), j4 = Symbol.for("react.activity"), S4 = Symbol.for("react.client.reference"), C4 = d29.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, O4 = Object.prototype.hasOwnProperty, _8 = Array.isArray, P4 = console.createTask ? console.createTask : function() {
|
|
156474
156474
|
return null;
|
|
156475
|
-
},
|
|
156475
|
+
}, A8 = {}, R8 = (d29 = { react_stack_bottom_frame: function(e489) {
|
|
156476
156476
|
return e489();
|
|
156477
156477
|
} }).react_stack_bottom_frame.bind(d29, o237)(), B4 = P4(a443(o237)), L4 = {};
|
|
156478
156478
|
cn.Fragment = p28, cn.jsx = function(e489, n470, t482) {
|
|
156479
156479
|
var r326 = 1e4 > C4.recentlyCreatedOwnerStacks++;
|
|
156480
|
-
return l52(e489, n470, t482, false, r326 ? Error("react-stack-top-frame") :
|
|
156480
|
+
return l52(e489, n470, t482, false, r326 ? Error("react-stack-top-frame") : R8, r326 ? P4(a443(e489)) : B4);
|
|
156481
156481
|
}, cn.jsxs = function(e489, n470, t482) {
|
|
156482
156482
|
var r326 = 1e4 > C4.recentlyCreatedOwnerStacks++;
|
|
156483
|
-
return l52(e489, n470, t482, true, r326 ? Error("react-stack-top-frame") :
|
|
156483
|
+
return l52(e489, n470, t482, true, r326 ? Error("react-stack-top-frame") : R8, r326 ? P4(a443(e489)) : B4);
|
|
156484
156484
|
};
|
|
156485
156485
|
}()), cn)), on.exports);
|
|
156486
156486
|
function sn(e488, n470, t481) {
|
|
@@ -156621,21 +156621,21 @@ function Pn(e488) {
|
|
|
156621
156621
|
})) === null || n470 === undefined ? undefined : n470.Inline;
|
|
156622
156622
|
return u28 ? un.jsx(u28, { annotation: o237, children: c105 }) : c105;
|
|
156623
156623
|
}
|
|
156624
|
-
function
|
|
156625
|
-
var t481 = [n470.fromLineNumber, n470.toLineNumber], r325 =
|
|
156626
|
-
r325 =
|
|
156624
|
+
function An(e488, n470) {
|
|
156625
|
+
var t481 = [n470.fromLineNumber, n470.toLineNumber], r325 = Rn(e488, t481[0]);
|
|
156626
|
+
r325 = Rn(r325, t481[1] + 1);
|
|
156627
156627
|
var a443 = [], o237 = [], i314 = [];
|
|
156628
156628
|
return r325.forEach(function(e489) {
|
|
156629
156629
|
e489.range[1] < t481[0] ? a443.push(e489) : e489.range[0] > t481[1] ? i314.push(e489) : o237.push(e489);
|
|
156630
156630
|
}), [].concat(a443, [{ annotation: n470, lines: o237, range: [o237[0].range[0], o237[o237.length - 1].range[1]] }], i314);
|
|
156631
156631
|
}
|
|
156632
|
-
function
|
|
156632
|
+
function Rn(e488, n470) {
|
|
156633
156633
|
var t481 = e488.findIndex(function(e489) {
|
|
156634
156634
|
return Bn(e489) && e489.range[0] < n470 && n470 <= e489.range[1];
|
|
156635
156635
|
});
|
|
156636
156636
|
if (t481 === -1)
|
|
156637
156637
|
return e488;
|
|
156638
|
-
var r325 = e488[t481], a443 =
|
|
156638
|
+
var r325 = e488[t481], a443 = Rn(r325.lines, n470), o237 = [], i314 = [];
|
|
156639
156639
|
return a443.forEach(function(e489) {
|
|
156640
156640
|
e489.range[1] < n470 ? o237.push(e489) : i314.push(e489);
|
|
156641
156641
|
}), [].concat(j2(e488.slice(0, t481)), [D2(D2({}, r325), {}, { lines: o237, range: [r325.range[0], n470 - 1] }), D2(D2({}, r325), {}, { lines: i314, range: [n470, r325.range[1]] })], j2(e488.slice(t481 + 1)));
|
|
@@ -156729,7 +156729,7 @@ function qn(e488) {
|
|
|
156729
156729
|
});
|
|
156730
156730
|
}(n470), o237 = r325.filter(We2), i314 = r325.filter(Ge2), l52 = function(e489, n471) {
|
|
156731
156731
|
for (var t482 = e489, r326 = n471.length - 1;r326 >= 0; r326--)
|
|
156732
|
-
t482 =
|
|
156732
|
+
t482 = An(t482, n471[r326]);
|
|
156733
156733
|
return t482;
|
|
156734
156734
|
}(a443, o237);
|
|
156735
156735
|
return Ln({ linesOrGroups: l52, handlers: t481, inlineAnnotations: i314 });
|
|
@@ -166736,7 +166736,7 @@ function gfmTableToMarkdown(options) {
|
|
|
166736
166736
|
{ character: "\r", inConstruct: "tableCell" },
|
|
166737
166737
|
{ character: `
|
|
166738
166738
|
`, inConstruct: "tableCell" },
|
|
166739
|
-
{ atBreak: true, character: "|", after: "[
|
|
166739
|
+
{ atBreak: true, character: "|", after: "[\t :-]" },
|
|
166740
166740
|
{ character: "|", inConstruct: "tableCell" },
|
|
166741
166741
|
{ atBreak: true, character: ":", after: "-" },
|
|
166742
166742
|
{ atBreak: true, character: "-", after: "[:|-]" }
|
|
@@ -191844,12 +191844,12 @@ class MCPServer {
|
|
|
191844
191844
|
transports = {};
|
|
191845
191845
|
sessionTokens = {};
|
|
191846
191846
|
uniformSource = "";
|
|
191847
|
-
constructor() {
|
|
191847
|
+
constructor(uniformSource = process.argv[2]) {
|
|
191848
191848
|
this.connect = this.connect.bind(this);
|
|
191849
191849
|
this.handleConnectionRequest = this.handleConnectionRequest.bind(this);
|
|
191850
191850
|
this.handleSessionRequest = this.handleSessionRequest.bind(this);
|
|
191851
|
-
if (
|
|
191852
|
-
this.uniformSource =
|
|
191851
|
+
if (uniformSource) {
|
|
191852
|
+
this.uniformSource = uniformSource;
|
|
191853
191853
|
}
|
|
191854
191854
|
}
|
|
191855
191855
|
async handleConnectionRequest(req, res) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyd-js/mcp-server",
|
|
3
|
-
"version": "0.0.0-build-
|
|
3
|
+
"version": "0.0.0-build-ae5d7ac-20251012020134",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MCP server for xyd",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
"./package.json": "./package.json",
|
|
9
9
|
".": {
|
|
10
10
|
"import": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./mcp": {
|
|
13
|
+
"import": "./dist/mcp.js"
|
|
11
14
|
}
|
|
12
15
|
},
|
|
13
16
|
"bin": {
|
|
@@ -16,7 +19,7 @@
|
|
|
16
19
|
"dependencies": {
|
|
17
20
|
"@modelcontextprotocol/sdk": "^1.18.1",
|
|
18
21
|
"express": "^5.1.0",
|
|
19
|
-
"@xyd-js/mcp": "0.0.0-build-
|
|
22
|
+
"@xyd-js/mcp": "0.0.0-build-ae5d7ac-20251012020134"
|
|
20
23
|
},
|
|
21
24
|
"devDependencies": {
|
|
22
25
|
"@types/express": "^4.17.21",
|
|
@@ -27,6 +30,7 @@
|
|
|
27
30
|
},
|
|
28
31
|
"scripts": {
|
|
29
32
|
"build": "bun build src/index.ts --outdir dist --target node --format esm",
|
|
33
|
+
"build:mcp": "bun build src/mcp.ts --outfile dist/mcp.js --target node --format esm",
|
|
30
34
|
"dev": "bun --watch src/index.ts",
|
|
31
35
|
"start": "bun dist/index.js",
|
|
32
36
|
"demo:simple": "bun --watch demo/simple/server.ts",
|
package/src/mcp.ts
CHANGED
|
@@ -26,13 +26,13 @@ export class MCPServer {
|
|
|
26
26
|
|
|
27
27
|
private uniformSource: string = "";
|
|
28
28
|
|
|
29
|
-
constructor() {
|
|
29
|
+
constructor(uniformSource: string = process.argv[2]) {
|
|
30
30
|
this.connect = this.connect.bind(this);
|
|
31
31
|
this.handleConnectionRequest = this.handleConnectionRequest.bind(this);
|
|
32
32
|
this.handleSessionRequest = this.handleSessionRequest.bind(this);
|
|
33
33
|
|
|
34
|
-
if (
|
|
35
|
-
this.uniformSource =
|
|
34
|
+
if (uniformSource) {
|
|
35
|
+
this.uniformSource = uniformSource;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|