mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
Update shellscript grammar to get fix (#173574)
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||
"Once accepted there, we are happy to receive an update request."
|
||||
],
|
||||
"version": "https://github.com/jeff-hykin/better-shell-syntax/commit/4ea3d7e5f6fb493395e417a26ba5483475e88af4",
|
||||
"version": "https://github.com/jeff-hykin/better-shell-syntax/commit/ab3c6da1c3651dff20651ebcf0ec5adb5fe413a0",
|
||||
"name": "Shell Script",
|
||||
"scopeName": "source.shell",
|
||||
"patterns": [
|
||||
@@ -14,7 +14,7 @@
|
||||
],
|
||||
"repository": {
|
||||
"alias_statement": {
|
||||
"begin": "(alias)(?:\\s)+\\s*+(?:((?<=^|;|&|\\s)(?:export|declare|typeset|local|readonly)(?=\\s|;|&|$))\\s*+)?((?<!\\w)[a-zA-Z_0-9]*(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9]*(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))",
|
||||
"begin": "(alias)\\s*+\\s*+(?:((?<=^|;|&|\\s)(?:export|declare|typeset|local|readonly)(?=\\s|;|&|$))\\s*+)?((?<!\\w)[a-zA-Z_0-9-]*(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9-]*(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))",
|
||||
"end": "(?:(?= |$)|(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n))",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
@@ -84,9 +84,10 @@
|
||||
"argument_context": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "[^ \n'&;<>\\(\\)\\$`\\\\\"\\|]+(?!>)",
|
||||
"match": "\\s*+([^ \n'&;<>\\(\\)\\$`\\\\\"\\|]+(?!>))",
|
||||
"captures": {
|
||||
"0": {
|
||||
"1": {
|
||||
"name": "string.unquoted.argument.shell",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\*",
|
||||
@@ -108,8 +109,7 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "string.unquoted.argument.shell"
|
||||
}
|
||||
},
|
||||
{
|
||||
"include": "#statement_context"
|
||||
@@ -119,7 +119,7 @@
|
||||
"assignment": {
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\s*+(?:((?<=^|;|&|\\s)(?:export|declare|typeset|local|readonly)(?=\\s|;|&|$))\\s*+)?((?<!\\w)[a-zA-Z_0-9]*(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9]*(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))\\s*+(\\()",
|
||||
"begin": "\\s*+(?:((?<=^|;|&|\\s)(?:export|declare|typeset|local|readonly)(?=\\s|;|&|$))\\s*+)?((?<!\\w)[a-zA-Z_0-9-]*(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9-]*(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))\\s*+(\\()",
|
||||
"end": "\\)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
@@ -166,7 +166,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "\\s*+(?:((?<=^|;|&|\\s)(?:export|declare|typeset|local|readonly)(?=\\s|;|&|$))\\s*+)?((?<!\\w)[a-zA-Z_0-9]*(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9]*(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))",
|
||||
"begin": "\\s*+(?:((?<=^|;|&|\\s)(?:export|declare|typeset|local|readonly)(?=\\s|;|&|$))\\s*+)?((?<!\\w)[a-zA-Z_0-9-]*(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9-]*(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))",
|
||||
"end": "(?:(?= |$)|(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n))",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
@@ -300,7 +300,7 @@
|
||||
},
|
||||
"command_call": {
|
||||
"begin": "(?!^[ \\t]*+$)(?:(?<=^if | if |\\tif |^elif | elif |\\telif |^then | then |\\tthen |^else | else |\\telse |^while | while |\\twhile |^do | do |\\tdo )|(?<=(?:^|;|\\||&|!|\\(|\\{|\\`)))\\s*+(?!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\\$)",
|
||||
"end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\)",
|
||||
"end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}| *#|\\])(?<!\\\\)",
|
||||
"beginCaptures": {},
|
||||
"endCaptures": {},
|
||||
"name": "meta.statement.shell",
|
||||
@@ -312,8 +312,8 @@
|
||||
"include": "#assignment"
|
||||
},
|
||||
{
|
||||
"begin": "(?:(\\s*+(?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s))([^ \n'&;<>\\(\\)\\$`\\\\\"\\|]+(?!>))?(?:(?:\\$')|'))|(\\s*+(?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s))([^ \n'&;<>\\(\\)\\$`\\\\\"\\|]+(?!>))?(?:(?:\\$\")|\")))",
|
||||
"end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\)",
|
||||
"begin": "(?:(\\s*+(?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s))(?:\\s*+([^ \n'&;<>\\(\\)\\$`\\\\\"\\|]+(?!>)))?(?:(?:\\$')|'))|(\\s*+(?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s))(?:\\s*+([^ \n'&;<>\\(\\)\\$`\\\\\"\\|]+(?!>)))?(?:(?:\\$\")|\")))",
|
||||
"end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}| *#|\\])(?<!\\\\)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "meta.command_name.quoted.shell string.quoted.single.shell punctuation.definition.string.begin.shell entity.name.command.shell"
|
||||
@@ -400,8 +400,8 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?:(\\s*+(?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s))(?:((?<=^|;|&|\\s)(?:export|declare|typeset|local|readonly)(?=\\s|;|&|$))|((?!\\\\\\n?$)(?:(?:\\$?\")|(?:.+?))))(?:(?=\\s)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\))))",
|
||||
"end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\)",
|
||||
"begin": "(?:(\\s*+(?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s))(?:((?<=^|;|&|\\s)(?:export|declare|typeset|local|readonly)(?=\\s|;|&|$))|((?!\\\\\\n?$)(?:(?:\\$?\")|(?:.+?))))(?:(?=\\s)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}| *#|\\])(?<!\\\\))))",
|
||||
"end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}| *#|\\])(?<!\\\\)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "meta.command_name.shell"
|
||||
@@ -452,7 +452,7 @@
|
||||
]
|
||||
},
|
||||
"command_name": {
|
||||
"match": "\\s*+(?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s))(?:((?<=^|;|&|\\s)(?:export|declare|typeset|local|readonly)(?=\\s|;|&|$))|((?!\\\\\\n?$)(?:(?:\\$?\")|(?:.+?))))(?:(?=\\s)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\))",
|
||||
"match": "\\s*+(?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s))(?:((?<=^|;|&|\\s)(?:export|declare|typeset|local|readonly)(?=\\s|;|&|$))|((?!\\\\\\n?$)(?:(?:\\$?\")|(?:.+?))))(?:(?=\\s)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}| *#|\\])(?<!\\\\))",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.$1.shell"
|
||||
@@ -477,7 +477,7 @@
|
||||
"name": "meta.command_name.shell"
|
||||
},
|
||||
"comment": {
|
||||
"match": "(?:^|(?<=\\s))(?:((#!).*)|((#).*))",
|
||||
"match": "(?:^|\\s++)(?:((#!).*)|((#).*))",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "comment.line.number-sign.shell meta.shebang.shell"
|
||||
@@ -702,7 +702,7 @@
|
||||
"heredoc": {
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "((?<!<)<<-)\\s*+(\"|')\\s*+((?<!\\w)[a-zA-Z_0-9]*(?!\\w))(?=\\s|;|&|<|\"|')(?:\\2)(.*)",
|
||||
"begin": "((?<!<)<<-)\\s*+(\"|')\\s*+((?<!\\w)[a-zA-Z_0-9-]*(?!\\w))(?=\\s|;|&|<|\"|')(?:\\2)(.*)",
|
||||
"end": "^\\t*(?:\\3)(?=\\s|;|&|$)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
@@ -729,7 +729,7 @@
|
||||
"patterns": []
|
||||
},
|
||||
{
|
||||
"begin": "((?<!<)<<(?!<))\\s*+(\"|')\\s*+((?<!\\w)[a-zA-Z_0-9]*(?!\\w))(?=\\s|;|&|<|\"|')(?:\\2)(.*)",
|
||||
"begin": "((?<!<)<<(?!<))\\s*+(\"|')\\s*+((?<!\\w)[a-zA-Z_0-9-]*(?!\\w))(?=\\s|;|&|<|\"|')(?:\\2)(.*)",
|
||||
"end": "^(?:\\3)(?=\\s|;|&|$)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
@@ -756,7 +756,7 @@
|
||||
"patterns": []
|
||||
},
|
||||
{
|
||||
"begin": "((?<!<)<<-)\\s*+((?<!\\w)[a-zA-Z_0-9]*(?!\\w))(?=\\s|;|&|<|\"|')(.*)",
|
||||
"begin": "((?<!<)<<-)\\s*+((?<!\\w)[a-zA-Z_0-9-]*(?!\\w))(?=\\s|;|&|<|\"|')(.*)",
|
||||
"end": "^\\t*(?:\\2)(?=\\s|;|&|$)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
@@ -792,7 +792,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "((?<!<)<<(?!<))\\s*+((?<!\\w)[a-zA-Z_0-9]*(?!\\w))(?=\\s|;|&|<|\"|')(.*)",
|
||||
"begin": "((?<!<)<<(?!<))\\s*+((?<!\\w)[a-zA-Z_0-9-]*(?!\\w))(?=\\s|;|&|<|\"|')(.*)",
|
||||
"end": "^(?:\\2)(?=\\s|;|&|$)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
@@ -928,9 +928,6 @@
|
||||
{
|
||||
"include": "#loop"
|
||||
},
|
||||
{
|
||||
"include": "#string"
|
||||
},
|
||||
{
|
||||
"include": "#function_definition"
|
||||
},
|
||||
@@ -961,6 +958,9 @@
|
||||
{
|
||||
"include": "#command_call"
|
||||
},
|
||||
{
|
||||
"include": "#string"
|
||||
},
|
||||
{
|
||||
"include": "#support"
|
||||
}
|
||||
@@ -1728,7 +1728,7 @@
|
||||
},
|
||||
"option": {
|
||||
"begin": "\\s++(-)((?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s)))",
|
||||
"end": "(?:(?=\\s)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\))",
|
||||
"end": "(?:(?=\\s)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}| *#|\\])(?<!\\\\))",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "string.unquoted.argument.shell constant.other.option.dash.shell"
|
||||
@@ -1900,7 +1900,7 @@
|
||||
}
|
||||
},
|
||||
"start_of_double_quoted_command_name": {
|
||||
"match": "\\s*+(?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s))([^ \n'&;<>\\(\\)\\$`\\\\\"\\|]+(?!>))?(?:(?:\\$\")|\")",
|
||||
"match": "\\s*+(?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s))(?:\\s*+([^ \n'&;<>\\(\\)\\$`\\\\\"\\|]+(?!>)))?(?:(?:\\$\")|\")",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "entity.name.command.shell",
|
||||
@@ -1929,7 +1929,7 @@
|
||||
"name": "meta.command_name.quoted.shell string.quoted.double.shell punctuation.definition.string.begin.shell entity.name.command.shell"
|
||||
},
|
||||
"start_of_single_quoted_command_name": {
|
||||
"match": "\\s*+(?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s))([^ \n'&;<>\\(\\)\\$`\\\\\"\\|]+(?!>))?(?:(?:\\$')|')",
|
||||
"match": "\\s*+(?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s))(?:\\s*+([^ \n'&;<>\\(\\)\\$`\\\\\"\\|]+(?!>)))?(?:(?:\\$')|')",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "entity.name.command.shell",
|
||||
|
||||
Reference in New Issue
Block a user