← All changes
|
build/shiki/languages/shellscript.tmLanguage.json
+586
-602
1.27.5
→
1.13.0
View file →
| @@ -3,9 +3,9 @@ | ||
| 3 | 3 | "This file has been converted from https://github.com/jeff-hykin/better-shell-syntax/blob/master/autogenerated/shell.tmLanguage.json", |
| 4 | 4 | "If you want to provide a fix or improvement, please create a pull request against the original repository.", |
| 5 | 5 | "Once accepted there, we are happy to receive an update request." |
| 6 | 6 | ], |
| 7 | - "version": "https://github.com/jeff-hykin/better-shell-syntax/commit/a3de7b32f1537194a83ee848838402fbf4b67424", | |
| 7 | + "version": "https://github.com/jeff-hykin/better-shell-syntax/commit/b05618771b35b4baa25661dff91170b4924fdac8", | |
| 8 | 8 | "name": "shellscript", |
| 9 | 9 | "scopeName": "source.shell", |
| 10 | 10 | "patterns": [ |
| 11 | 11 | { |
| @@ -13,37 +13,34 @@ | ||
| 13 | 13 | } |
| 14 | 14 | ], |
| 15 | 15 | "repository": { |
| 16 | 16 | "alias_statement": { |
| 17 | - "begin": "(alias)[ \\t]*+[ \\t]*+(?:((?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$))[ \\t]*+)?((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))", | |
| 18 | - "end": "(?:(?= |\\t|$)|(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n))", | |
| 17 | + "begin": "(alias)(?:\\s)+\\s*+((?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))", | |
| 18 | + "end": "(?:(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n)|(?= |$))", | |
| 19 | 19 | "beginCaptures": { |
| 20 | 20 | "1": { |
| 21 | 21 | "name": "storage.type.alias.shell" |
| 22 | 22 | }, |
| 23 | 23 | "2": { |
| 24 | - "name": "storage.modifier.$2.shell" | |
| 24 | + "name": "variable.other.assignment.shell" | |
| 25 | 25 | }, |
| 26 | 26 | "3": { |
| 27 | - "name": "variable.other.assignment.shell" | |
| 27 | + "name": "punctuation.definition.array.access.shell" | |
| 28 | 28 | }, |
| 29 | 29 | "4": { |
| 30 | - "name": "punctuation.definition.array.access.shell" | |
| 30 | + "name": "variable.other.assignment.shell" | |
| 31 | 31 | }, |
| 32 | 32 | "5": { |
| 33 | - "name": "variable.other.assignment.shell" | |
| 33 | + "name": "punctuation.definition.array.access.shell" | |
| 34 | 34 | }, |
| 35 | 35 | "6": { |
| 36 | - "name": "punctuation.definition.array.access.shell" | |
| 36 | + "name": "keyword.operator.assignment.shell" | |
| 37 | 37 | }, |
| 38 | 38 | "7": { |
| 39 | - "name": "keyword.operator.assignment.shell" | |
| 39 | + "name": "keyword.operator.assignment.compound.shell" | |
| 40 | 40 | }, |
| 41 | 41 | "8": { |
| 42 | 42 | "name": "keyword.operator.assignment.compound.shell" |
| 43 | - }, | |
| 44 | - "9": { | |
| 45 | - "name": "keyword.operator.assignment.compound.shell" | |
| 46 | 43 | } |
| 47 | 44 | }, |
| 48 | 45 | "endCaptures": { |
| 49 | 46 | "1": { |
| @@ -61,15 +58,15 @@ | ||
| 61 | 58 | }, |
| 62 | 59 | "name": "meta.expression.assignment.shell", |
| 63 | 60 | "patterns": [ |
| 64 | 61 | { |
| 65 | - "include": "#normal_statement_context" | |
| 62 | + "include": "#statement_context" | |
| 66 | 63 | } |
| 67 | 64 | ] |
| 68 | 65 | }, |
| 69 | 66 | "argument": { |
| 70 | - "begin": "[ \\t]++(?!(?:&|\\||\\(|\\[|#|\\n|$|;))", | |
| 71 | - "end": "(?= |\\t|;|\\||&|$|\\n|\\)|\\`)", | |
| 67 | + "begin": "\\s++(?!(?:%|&|\\||\\(|\\[|#|\\n|$|;))", | |
| 68 | + "end": "(?=\\s|;|\\||&|$|\\n|\\)|\\`)", | |
| 72 | 69 | "beginCaptures": {}, |
| 73 | 70 | "endCaptures": {}, |
| 74 | 71 | "name": "meta.argument.shell", |
| 75 | 72 | "patterns": [ |
| @@ -83,12 +80,11 @@ | ||
| 83 | 80 | }, |
| 84 | 81 | "argument_context": { |
| 85 | 82 | "patterns": [ |
| 86 | 83 | { |
| 87 | - "match": "[ \\t]*+([^ \t\n'&;<>\\(\\)\\$`\\\\\"\\|]+(?!>))", | |
| 84 | + "match": "[^ \n'&;<>\\(\\)\\$`\\\\\"\\|]+(?!>)", | |
| 88 | 85 | "captures": { |
| 89 | - "1": { | |
| 90 | - "name": "string.unquoted.argument.shell", | |
| 86 | + "0": { | |
| 91 | 87 | "patterns": [ |
| 92 | 88 | { |
| 93 | 89 | "match": "\\*", |
| 94 | 90 | "name": "variable.language.special.wildcard.shell" |
| @@ -108,143 +104,62 @@ | ||
| 108 | 104 | } |
| 109 | 105 | } |
| 110 | 106 | ] |
| 111 | 107 | } |
| 112 | - } | |
| 108 | + }, | |
| 109 | + "name": "string.unquoted.argument.shell" | |
| 113 | 110 | }, |
| 114 | 111 | { |
| 115 | - "include": "#normal_statement_context" | |
| 112 | + "include": "#statement_context" | |
| 116 | 113 | } |
| 117 | 114 | ] |
| 118 | 115 | }, |
| 119 | 116 | "assignment": { |
| 120 | - "patterns": [ | |
| 121 | - { | |
| 122 | - "begin": "[ \\t]*+(?:((?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$))[ \\t]*+)?((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))[ \\t]*+(\\()", | |
| 123 | - "end": "\\)", | |
| 124 | - "beginCaptures": { | |
| 125 | - "1": { | |
| 126 | - "name": "storage.modifier.$1.shell" | |
| 127 | - }, | |
| 128 | - "2": { | |
| 129 | - "name": "variable.other.assignment.shell" | |
| 130 | - }, | |
| 131 | - "3": { | |
| 132 | - "name": "punctuation.definition.array.access.shell" | |
| 133 | - }, | |
| 134 | - "4": { | |
| 135 | - "name": "variable.other.assignment.shell" | |
| 136 | - }, | |
| 137 | - "5": { | |
| 138 | - "name": "punctuation.definition.array.access.shell" | |
| 139 | - }, | |
| 140 | - "6": { | |
| 141 | - "name": "keyword.operator.assignment.shell" | |
| 142 | - }, | |
| 143 | - "7": { | |
| 144 | - "name": "keyword.operator.assignment.compound.shell" | |
| 145 | - }, | |
| 146 | - "8": { | |
| 147 | - "name": "keyword.operator.assignment.compound.shell" | |
| 148 | - }, | |
| 149 | - "9": { | |
| 150 | - "name": "punctuation.shell" | |
| 151 | - } | |
| 152 | - }, | |
| 153 | - "endCaptures": { | |
| 154 | - "0": { | |
| 155 | - "name": "punctuation.shell" | |
| 156 | - } | |
| 157 | - }, | |
| 158 | - "name": "meta.expression.assignment.shell", | |
| 159 | - "patterns": [ | |
| 160 | - { | |
| 161 | - "include": "#comment" | |
| 162 | - }, | |
| 163 | - { | |
| 164 | - "include": "#argument_context" | |
| 165 | - } | |
| 166 | - ] | |
| 117 | + "begin": "\\s*+((?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))", | |
| 118 | + "end": "(?:(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n)|(?= |$))", | |
| 119 | + "beginCaptures": { | |
| 120 | + "1": { | |
| 121 | + "name": "variable.other.assignment.shell" | |
| 167 | 122 | }, |
| 168 | - { | |
| 169 | - "begin": "[ \\t]*+(?:((?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$))[ \\t]*+)?((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))", | |
| 170 | - "end": "(?:(?= |\\t|$)|(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n))", | |
| 171 | - "beginCaptures": { | |
| 172 | - "1": { | |
| 173 | - "name": "storage.modifier.$1.shell" | |
| 174 | - }, | |
| 175 | - "2": { | |
| 176 | - "name": "variable.other.assignment.shell" | |
| 177 | - }, | |
| 178 | - "3": { | |
| 179 | - "name": "punctuation.definition.array.access.shell" | |
| 180 | - }, | |
| 181 | - "4": { | |
| 182 | - "name": "variable.other.assignment.shell" | |
| 183 | - }, | |
| 184 | - "5": { | |
| 185 | - "name": "punctuation.definition.array.access.shell" | |
| 186 | - }, | |
| 187 | - "6": { | |
| 188 | - "name": "keyword.operator.assignment.shell" | |
| 189 | - }, | |
| 190 | - "7": { | |
| 191 | - "name": "keyword.operator.assignment.compound.shell" | |
| 192 | - }, | |
| 193 | - "8": { | |
| 194 | - "name": "keyword.operator.assignment.compound.shell" | |
| 195 | - } | |
| 196 | - }, | |
| 197 | - "endCaptures": { | |
| 198 | - "1": { | |
| 199 | - "name": "punctuation.terminator.statement.semicolon.shell" | |
| 200 | - }, | |
| 201 | - "2": { | |
| 202 | - "name": "punctuation.separator.statement.and.shell" | |
| 203 | - }, | |
| 204 | - "3": { | |
| 205 | - "name": "punctuation.separator.statement.or.shell" | |
| 206 | - }, | |
| 207 | - "4": { | |
| 208 | - "name": "punctuation.separator.statement.background.shell" | |
| 209 | - } | |
| 210 | - }, | |
| 211 | - "name": "meta.expression.assignment.shell", | |
| 212 | - "patterns": [ | |
| 213 | - { | |
| 214 | - "include": "#comment" | |
| 215 | - }, | |
| 216 | - { | |
| 217 | - "include": "#argument_context" | |
| 218 | - } | |
| 219 | - ] | |
| 123 | + "2": { | |
| 124 | + "name": "punctuation.definition.array.access.shell" | |
| 125 | + }, | |
| 126 | + "3": { | |
| 127 | + "name": "variable.other.assignment.shell" | |
| 128 | + }, | |
| 129 | + "4": { | |
| 130 | + "name": "punctuation.definition.array.access.shell" | |
| 131 | + }, | |
| 132 | + "5": { | |
| 133 | + "name": "keyword.operator.assignment.shell" | |
| 134 | + }, | |
| 135 | + "6": { | |
| 136 | + "name": "keyword.operator.assignment.compound.shell" | |
| 137 | + }, | |
| 138 | + "7": { | |
| 139 | + "name": "keyword.operator.assignment.compound.shell" | |
| 220 | 140 | } |
| 221 | - ] | |
| 222 | - }, | |
| 223 | - "basic_command_name": { | |
| 224 | - "match": "(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!foreach\\b(?!\\/)|select\\b(?!\\/)|repeat\\b(?!\\/)|until\\b(?!\\/)|while\\b(?!\\/)|case\\b(?!\\/)|done\\b(?!\\/)|elif\\b(?!\\/)|else\\b(?!\\/)|esac\\b(?!\\/)|then\\b(?!\\/)|for\\b(?!\\/)|end\\b(?!\\/)|in\\b(?!\\/)|fi\\b(?!\\/)|do\\b(?!\\/)|if\\b(?!\\/))(?:((?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$))|((?!\"|'|\\\\\\n?$)[^!'\" \\t\\n\\r]+?))(?:(?= |\\t)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\))", | |
| 225 | - "captures": { | |
| 141 | + }, | |
| 142 | + "endCaptures": { | |
| 226 | 143 | "1": { |
| 227 | - "name": "storage.modifier.$1.shell" | |
| 144 | + "name": "punctuation.terminator.statement.semicolon.shell" | |
| 228 | 145 | }, |
| 229 | 146 | "2": { |
| 230 | - "name": "entity.name.function.call.shell entity.name.command.shell", | |
| 231 | - "patterns": [ | |
| 232 | - { | |
| 233 | - "match": "(?<!\\w)(?:continue|return|break)(?!\\w)", | |
| 234 | - "name": "keyword.control.$0.shell" | |
| 235 | - }, | |
| 236 | - { | |
| 237 | - "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)", | |
| 238 | - "name": "support.function.builtin.shell" | |
| 239 | - }, | |
| 240 | - { | |
| 241 | - "include": "#variable" | |
| 242 | - } | |
| 243 | - ] | |
| 147 | + "name": "punctuation.separator.statement.and.shell" | |
| 148 | + }, | |
| 149 | + "3": { | |
| 150 | + "name": "punctuation.separator.statement.or.shell" | |
| 151 | + }, | |
| 152 | + "4": { | |
| 153 | + "name": "punctuation.separator.statement.background.shell" | |
| 244 | 154 | } |
| 245 | 155 | }, |
| 246 | - "name": "meta.statement.command.name.basic.shell" | |
| 156 | + "name": "meta.expression.assignment.shell", | |
| 157 | + "patterns": [ | |
| 158 | + { | |
| 159 | + "include": "#argument_context" | |
| 160 | + } | |
| 161 | + ] | |
| 247 | 162 | }, |
| 248 | 163 | "block_comment": { |
| 249 | 164 | "begin": "\\s*+(\\/\\*)", |
| 250 | 165 | "end": "\\*\\/", |
| @@ -267,9 +182,9 @@ | ||
| 267 | 182 | "case-clause": { |
| 268 | 183 | "patterns": [ |
| 269 | 184 | { |
| 270 | 185 | "begin": "(?=\\S)", |
| 271 | - "end": ";;&?|;&", | |
| 186 | + "end": ";;", | |
| 272 | 187 | "endCaptures": { |
| 273 | 188 | "0": { |
| 274 | 189 | "name": "punctuation.terminator.case-clause.shell" |
| 275 | 190 | } |
| @@ -310,9 +225,9 @@ | ||
| 310 | 225 | ] |
| 311 | 226 | }, |
| 312 | 227 | { |
| 313 | 228 | "begin": "(?<=\\))", |
| 314 | - "end": "(?=;;&?|;&)", | |
| 229 | + "end": "(?=;;)", | |
| 315 | 230 | "name": "meta.scope.case-clause-body.shell", |
| 316 | 231 | "patterns": [ |
| 317 | 232 | { |
| 318 | 233 | "include": "#initial_context" |
| @@ -322,10 +237,88 @@ | ||
| 322 | 237 | ] |
| 323 | 238 | } |
| 324 | 239 | ] |
| 325 | 240 | }, |
| 241 | + "command_call": { | |
| 242 | + "begin": "(?!^ *+$)(?<=(?:^|;|\\||&|!|\\(|\\{|\\`))\\s*+(?!nocorrect\\W|nocorrect\\$|readonly\\W|readonly\\$|function\\W|function\\$|foreach\\W|foreach\\$|coproc\\W|coproc\\$|logout\\W|logout\\$|export\\W|export\\$|select\\W|select\\$|repeat\\W|repeat\\$|pushd\\W|pushd\\$|until\\W|until\\$|while\\W|while\\$|local\\W|local\\$|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\\$)", | |
| 243 | + "end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\)", | |
| 244 | + "beginCaptures": {}, | |
| 245 | + "endCaptures": {}, | |
| 246 | + "name": "meta.statement.shell", | |
| 247 | + "patterns": [ | |
| 248 | + { | |
| 249 | + "begin": "\\s*+(?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s))(.+?)(?:(?=\\s)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\))", | |
| 250 | + "end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\)", | |
| 251 | + "beginCaptures": { | |
| 252 | + "0": { | |
| 253 | + "name": "meta.command_name.shell" | |
| 254 | + }, | |
| 255 | + "1": { | |
| 256 | + "name": "entity.name.command.shell", | |
| 257 | + "patterns": [ | |
| 258 | + { | |
| 259 | + "match": "(?<!\\w)(?:return|break)(?!\\w)", | |
| 260 | + "name": "keyword.control.$0.shell" | |
| 261 | + }, | |
| 262 | + { | |
| 263 | + "match": "(?<!\\w)(?:unfunction|unsetopt|autoload|unlimit|bindkey|builtin|command|getopts|history|declare|unalias|typeset|suspend|return|source|ulimit|unhash|disown|which|alias|break|false|print|shift|times|umask|umask|unset|read|type|exec|eval|wait|echo|dirs|hash|jobs|kill|stat|exit|test|trap|true|pwd|let|set|cd|fg|bg|fc|:|\\.)(?!\\w)", | |
| 264 | + "name": "support.function.builtin.shell" | |
| 265 | + }, | |
| 266 | + { | |
| 267 | + "include": "#variable" | |
| 268 | + } | |
| 269 | + ] | |
| 270 | + } | |
| 271 | + }, | |
| 272 | + "endCaptures": {}, | |
| 273 | + "name": "meta.command.shell", | |
| 274 | + "patterns": [ | |
| 275 | + { | |
| 276 | + "include": "#line_continuation" | |
| 277 | + }, | |
| 278 | + { | |
| 279 | + "include": "#option" | |
| 280 | + }, | |
| 281 | + { | |
| 282 | + "include": "#argument" | |
| 283 | + }, | |
| 284 | + { | |
| 285 | + "include": "#statement_context" | |
| 286 | + } | |
| 287 | + ] | |
| 288 | + }, | |
| 289 | + { | |
| 290 | + "include": "#line_continuation" | |
| 291 | + }, | |
| 292 | + { | |
| 293 | + "include": "#statement_context" | |
| 294 | + } | |
| 295 | + ] | |
| 296 | + }, | |
| 297 | + "command_name": { | |
| 298 | + "match": "\\s*+(?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s))(.+?)(?:(?=\\s)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\))", | |
| 299 | + "captures": { | |
| 300 | + "1": { | |
| 301 | + "name": "entity.name.command.shell", | |
| 302 | + "patterns": [ | |
| 303 | + { | |
| 304 | + "match": "(?<!\\w)(?:return|break)(?!\\w)", | |
| 305 | + "name": "keyword.control.$0.shell" | |
| 306 | + }, | |
| 307 | + { | |
| 308 | + "match": "(?<!\\w)(?:unfunction|unsetopt|autoload|unlimit|bindkey|builtin|command|getopts|history|declare|unalias|typeset|suspend|return|source|ulimit|unhash|disown|which|alias|break|false|print|shift|times|umask|umask|unset|read|type|exec|eval|wait|echo|dirs|hash|jobs|kill|stat|exit|test|trap|true|pwd|let|set|cd|fg|bg|fc|:|\\.)(?!\\w)", | |
| 309 | + "name": "support.function.builtin.shell" | |
| 310 | + }, | |
| 311 | + { | |
| 312 | + "include": "#variable" | |
| 313 | + } | |
| 314 | + ] | |
| 315 | + } | |
| 316 | + }, | |
| 317 | + "name": "meta.command_name.shell" | |
| 318 | + }, | |
| 326 | 319 | "comment": { |
| 327 | - "match": "(?:^|[ \\t]++)(?:((#!).*)|((#).*))", | |
| 320 | + "match": "(?<=^|\\s)(?:((#!).*)|((#).*))", | |
| 328 | 321 | "captures": { |
| 329 | 322 | "1": { |
| 330 | 323 | "name": "comment.line.number-sign.shell meta.shebang.shell" |
| 331 | 324 | }, |
| @@ -436,42 +429,8 @@ | ||
| 436 | 429 | ] |
| 437 | 430 | } |
| 438 | 431 | ] |
| 439 | 432 | }, |
| 440 | - "continuation_of_double_quoted_command_name": { | |
| 441 | - "begin": "\\G(?<=\")", | |
| 442 | - "end": "\"", | |
| 443 | - "beginCaptures": {}, | |
| 444 | - "endCaptures": { | |
| 445 | - "0": { | |
| 446 | - "name": "string.quoted.double.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell" | |
| 447 | - } | |
| 448 | - }, | |
| 449 | - "contentName": "meta.statement.command.name.continuation string.quoted.double entity.name.function.call entity.name.command", | |
| 450 | - "patterns": [ | |
| 451 | - { | |
| 452 | - "match": "\\\\[\\$\\n`\"\\\\]", | |
| 453 | - "name": "constant.character.escape.shell" | |
| 454 | - }, | |
| 455 | - { | |
| 456 | - "include": "#variable" | |
| 457 | - }, | |
| 458 | - { | |
| 459 | - "include": "#interpolation" | |
| 460 | - } | |
| 461 | - ] | |
| 462 | - }, | |
| 463 | - "continuation_of_single_quoted_command_name": { | |
| 464 | - "begin": "\\G(?<=')", | |
| 465 | - "end": "'", | |
| 466 | - "beginCaptures": {}, | |
| 467 | - "endCaptures": { | |
| 468 | - "0": { | |
| 469 | - "name": "string.quoted.single.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell" | |
| 470 | - } | |
| 471 | - }, | |
| 472 | - "contentName": "meta.statement.command.name.continuation string.quoted.single entity.name.function.call entity.name.command" | |
| 473 | - }, | |
| 474 | 433 | "custom_command_names": { |
| 475 | 434 | "patterns": [] |
| 476 | 435 | }, |
| 477 | 436 | "custom_commands": { |
| @@ -476,72 +435,34 @@ | ||
| 476 | 435 | }, |
| 477 | 436 | "custom_commands": { |
| 478 | 437 | "patterns": [] |
| 479 | 438 | }, |
| 480 | - "double_quote_context": { | |
| 481 | - "patterns": [ | |
| 482 | - { | |
| 483 | - "match": "\\\\[\\$`\"\\\\\\n]", | |
| 484 | - "name": "constant.character.escape.shell" | |
| 485 | - }, | |
| 486 | - { | |
| 487 | - "include": "#variable" | |
| 488 | - }, | |
| 489 | - { | |
| 490 | - "include": "#interpolation" | |
| 491 | - } | |
| 492 | - ] | |
| 493 | - }, | |
| 494 | 439 | "double_quote_escape_char": { |
| 495 | 440 | "match": "\\\\[\\$`\"\\\\\\n]", |
| 496 | 441 | "name": "constant.character.escape.shell" |
| 497 | 442 | }, |
| 498 | - "function_definition": { | |
| 499 | - "begin": "[ \\t]*+(?:(\\bfunction\\b)[ \\t]*+([^ \\t\\n\\r\\(\\)=]+)(?:(\\()[ \\t]*+(\\)))?|([^ \\t\\n\\r\\(\\)=]+)[ \\t]*+(\\()[ \\t]*+(\\)))", | |
| 500 | - "end": "(?<=\\}|\\))", | |
| 501 | - "beginCaptures": { | |
| 502 | - "1": { | |
| 503 | - "name": "storage.type.function.shell" | |
| 504 | - }, | |
| 505 | - "2": { | |
| 506 | - "name": "entity.name.function.shell" | |
| 507 | - }, | |
| 508 | - "3": { | |
| 509 | - "name": "punctuation.definition.arguments.shell" | |
| 510 | - }, | |
| 511 | - "4": { | |
| 512 | - "name": "punctuation.definition.arguments.shell" | |
| 513 | - }, | |
| 514 | - "5": { | |
| 515 | - "name": "entity.name.function.shell" | |
| 516 | - }, | |
| 517 | - "6": { | |
| 518 | - "name": "punctuation.definition.arguments.shell" | |
| 519 | - }, | |
| 520 | - "7": { | |
| 521 | - "name": "punctuation.definition.arguments.shell" | |
| 522 | - } | |
| 523 | - }, | |
| 524 | - "endCaptures": {}, | |
| 525 | - "name": "meta.function.shell", | |
| 443 | + "function-definition": { | |
| 526 | 444 | "patterns": [ |
| 527 | 445 | { |
| 528 | - "match": "\\G(?:\\t| |\\n)" | |
| 529 | - }, | |
| 530 | - { | |
| 531 | - "begin": "\\{", | |
| 532 | - "end": "\\}", | |
| 446 | + "begin": "(?:^\\s*|(?<=^|;|&|\\s))(function)\\s+([^\\s\\\\]+)(?:\\s*(\\(\\)))?", | |
| 533 | 447 | "beginCaptures": { |
| 534 | - "0": { | |
| 535 | - "name": "punctuation.definition.group.shell punctuation.section.function.definition.shell" | |
| 448 | + "1": { | |
| 449 | + "name": "storage.type.function.shell" | |
| 450 | + }, | |
| 451 | + "2": { | |
| 452 | + "name": "entity.name.function.shell" | |
| 453 | + }, | |
| 454 | + "3": { | |
| 455 | + "name": "punctuation.definition.arguments.shell" | |
| 536 | 456 | } |
| 537 | 457 | }, |
| 458 | + "end": ";|&|$", | |
| 538 | 459 | "endCaptures": { |
| 539 | 460 | "0": { |
| 540 | - "name": "punctuation.definition.group.shell punctuation.section.function.definition.shell" | |
| 461 | + "name": "punctuation.definition.function.shell" | |
| 541 | 462 | } |
| 542 | 463 | }, |
| 543 | - "name": "meta.function.body.shell", | |
| 464 | + "name": "meta.function.shell", | |
| 544 | 465 | "patterns": [ |
| 545 | 466 | { |
| 546 | 467 | "include": "#initial_context" |
| 547 | 468 | } |
| @@ -547,21 +468,24 @@ | ||
| 547 | 468 | } |
| 548 | 469 | ] |
| 549 | 470 | }, |
| 550 | 471 | { |
| 551 | - "begin": "\\(", | |
| 552 | - "end": "\\)", | |
| 472 | + "begin": "(?:^\\s*|(?<=^|;|&|\\s))([^\\s\\\\=]+)\\s*(\\(\\))", | |
| 553 | 473 | "beginCaptures": { |
| 554 | - "0": { | |
| 555 | - "name": "punctuation.definition.group.shell punctuation.section.function.definition.shell" | |
| 474 | + "1": { | |
| 475 | + "name": "entity.name.function.shell" | |
| 476 | + }, | |
| 477 | + "2": { | |
| 478 | + "name": "punctuation.definition.arguments.shell" | |
| 556 | 479 | } |
| 557 | 480 | }, |
| 481 | + "end": ";|&|$", | |
| 558 | 482 | "endCaptures": { |
| 559 | 483 | "0": { |
| 560 | - "name": "punctuation.definition.group.shell punctuation.section.function.definition.shell" | |
| 484 | + "name": "punctuation.definition.function.shell" | |
| 561 | 485 | } |
| 562 | 486 | }, |
| 563 | - "name": "meta.function.body.shell", | |
| 487 | + "name": "meta.function.shell", | |
| 564 | 488 | "patterns": [ |
| 565 | 489 | { |
| 566 | 490 | "include": "#initial_context" |
| 567 | 491 | } |
| @@ -566,16 +490,15 @@ | ||
| 566 | 490 | "include": "#initial_context" |
| 567 | 491 | } |
| 568 | 492 | ] |
| 569 | 493 | } |
| 570 | - ], | |
| 571 | - "applyEndPatternLast": 1 | |
| 494 | + ] | |
| 572 | 495 | }, |
| 573 | 496 | "heredoc": { |
| 574 | 497 | "patterns": [ |
| 575 | 498 | { |
| 576 | - "begin": "((?<!<)<<-)[ \\t]*+(\"|')[ \\t]*+((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?=\\s|;|&|<|\"|')(?:\\2)(.*)", | |
| 577 | - "end": "^\\t*(?:\\3)(?=\\s|;|&|$)", | |
| 499 | + "begin": "(<<-)\\s*+(\"|')\\s*+((?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w))(?=\\s|;|&|<|\"|')\\2", | |
| 500 | + "end": "^\\t*\\3(?=\\s|;|&|$)", | |
| 578 | 501 | "beginCaptures": { |
| 579 | 502 | "1": { |
| 580 | 503 | "name": "keyword.operator.heredoc.shell" |
| 581 | 504 | }, |
| @@ -581,15 +504,8 @@ | ||
| 581 | 504 | }, |
| 582 | 505 | "2": {}, |
| 583 | 506 | "3": { |
| 584 | 507 | "name": "punctuation.definition.string.heredoc.shell" |
| 585 | - }, | |
| 586 | - "4": { | |
| 587 | - "patterns": [ | |
| 588 | - { | |
| 589 | - "include": "#normal_statement_context" | |
| 590 | - } | |
| 591 | - ] | |
| 592 | 508 | } |
| 593 | 509 | }, |
| 594 | 510 | "endCaptures": { |
| 595 | 511 | "0": { |
| @@ -595,14 +511,14 @@ | ||
| 595 | 511 | "0": { |
| 596 | 512 | "name": "punctuation.definition.string.heredoc.shell" |
| 597 | 513 | } |
| 598 | 514 | }, |
| 599 | - "contentName": "string.quoted.heredoc.indent", | |
| 515 | + "name": "string.quoted.heredoc.indent.shell", | |
| 600 | 516 | "patterns": [] |
| 601 | 517 | }, |
| 602 | 518 | { |
| 603 | - "begin": "((?<!<)<<(?!<))[ \\t]*+(\"|')[ \\t]*+((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?=\\s|;|&|<|\"|')(?:\\2)(.*)", | |
| 604 | - "end": "^(?:\\3)(?=\\s|;|&|$)", | |
| 519 | + "begin": "(<<)\\s*+(\"|')\\s*+((?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w))(?=\\s|;|&|<|\"|')\\2", | |
| 520 | + "end": "^\\3(?=\\s|;|&|$)", | |
| 605 | 521 | "beginCaptures": { |
| 606 | 522 | "1": { |
| 607 | 523 | "name": "keyword.operator.heredoc.shell" |
| 608 | 524 | }, |
| @@ -608,15 +524,8 @@ | ||
| 608 | 524 | }, |
| 609 | 525 | "2": {}, |
| 610 | 526 | "3": { |
| 611 | 527 | "name": "punctuation.definition.string.heredoc.shell" |
| 612 | - }, | |
| 613 | - "4": { | |
| 614 | - "patterns": [ | |
| 615 | - { | |
| 616 | - "include": "#normal_statement_context" | |
| 617 | - } | |
| 618 | - ] | |
| 619 | 528 | } |
| 620 | 529 | }, |
| 621 | 530 | "endCaptures": { |
| 622 | 531 | "0": { |
| @@ -622,14 +531,14 @@ | ||
| 622 | 531 | "0": { |
| 623 | 532 | "name": "punctuation.definition.string.heredoc.shell" |
| 624 | 533 | } |
| 625 | 534 | }, |
| 626 | - "contentName": "string.quoted.heredoc.no-indent", | |
| 535 | + "name": "string.quoted.heredoc.no-indent.shell", | |
| 627 | 536 | "patterns": [] |
| 628 | 537 | }, |
| 629 | 538 | { |
| 630 | - "begin": "((?<!<)<<-)[ \\t]*+((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?=\\s|;|&|<|\"|')(.*)", | |
| 631 | - "end": "^\\t*(?:\\2)(?=\\s|;|&|$)", | |
| 539 | + "begin": "(<<-)\\s*+((?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w))(?=\\s|;|&|<|\"|')", | |
| 540 | + "end": "^\\t*\\2(?=\\s|;|&|$)", | |
| 632 | 541 | "beginCaptures": { |
| 633 | 542 | "1": { |
| 634 | 543 | "name": "keyword.operator.heredoc.shell" |
| 635 | 544 | }, |
| @@ -634,15 +543,8 @@ | ||
| 634 | 543 | "name": "keyword.operator.heredoc.shell" |
| 635 | 544 | }, |
| 636 | 545 | "2": { |
| 637 | 546 | "name": "punctuation.definition.string.heredoc.shell" |
| 638 | - }, | |
| 639 | - "3": { | |
| 640 | - "patterns": [ | |
| 641 | - { | |
| 642 | - "include": "#normal_statement_context" | |
| 643 | - } | |
| 644 | - ] | |
| 645 | 547 | } |
| 646 | 548 | }, |
| 647 | 549 | "endCaptures": { |
| 648 | 550 | "0": { |
| @@ -648,9 +550,9 @@ | ||
| 648 | 550 | "0": { |
| 649 | 551 | "name": "punctuation.definition.string.heredoc.shell" |
| 650 | 552 | } |
| 651 | 553 | }, |
| 652 | - "contentName": "string.unquoted.heredoc.indent", | |
| 554 | + "name": "string.unquoted.heredoc.indent.shell", | |
| 653 | 555 | "patterns": [ |
| 654 | 556 | { |
| 655 | 557 | "include": "#double_quote_escape_char" |
| 656 | 558 | }, |
| @@ -662,10 +564,10 @@ | ||
| 662 | 564 | } |
| 663 | 565 | ] |
| 664 | 566 | }, |
| 665 | 567 | { |
| 666 | - "begin": "((?<!<)<<(?!<))[ \\t]*+((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?=\\s|;|&|<|\"|')(.*)", | |
| 667 | - "end": "^(?:\\2)(?=\\s|;|&|$)", | |
| 568 | + "begin": "(<<)\\s*+((?<!\\w)[a-zA-Z_][a-zA-Z_0-9]*(?!\\w))(?=\\s|;|&|<|\"|')", | |
| 569 | + "end": "^\\2(?=\\s|;|&|$)", | |
| 668 | 570 | "beginCaptures": { |
| 669 | 571 | "1": { |
| 670 | 572 | "name": "keyword.operator.heredoc.shell" |
| 671 | 573 | }, |
| @@ -670,15 +572,8 @@ | ||
| 670 | 572 | "name": "keyword.operator.heredoc.shell" |
| 671 | 573 | }, |
| 672 | 574 | "2": { |
| 673 | 575 | "name": "punctuation.definition.string.heredoc.shell" |
| 674 | - }, | |
| 675 | - "3": { | |
| 676 | - "patterns": [ | |
| 677 | - { | |
| 678 | - "include": "#normal_statement_context" | |
| 679 | - } | |
| 680 | - ] | |
| 681 | 576 | } |
| 682 | 577 | }, |
| 683 | 578 | "endCaptures": { |
| 684 | 579 | "0": { |
| @@ -684,9 +579,9 @@ | ||
| 684 | 579 | "0": { |
| 685 | 580 | "name": "punctuation.definition.string.heredoc.shell" |
| 686 | 581 | } |
| 687 | 582 | }, |
| 688 | - "contentName": "string.unquoted.heredoc.no-indent", | |
| 583 | + "name": "string.unquoted.heredoc.no-indent.shell", | |
| 689 | 584 | "patterns": [ |
| 690 | 585 | { |
| 691 | 586 | "include": "#double_quote_escape_char" |
| 692 | 587 | }, |
| @@ -749,14 +644,9 @@ | ||
| 749 | 644 | "name": "punctuation.definition.string.end.shell" |
| 750 | 645 | } |
| 751 | 646 | }, |
| 752 | 647 | "name": "meta.herestring.shell", |
| 753 | - "contentName": "string.quoted.double.shell", | |
| 754 | - "patterns": [ | |
| 755 | - { | |
| 756 | - "include": "#double_quote_context" | |
| 757 | - } | |
| 758 | - ] | |
| 648 | + "contentName": "string.quoted.double.shell" | |
| 759 | 649 | }, |
| 760 | 650 | { |
| 761 | 651 | "captures": { |
| 762 | 652 | "1": { |
| @@ -781,12 +671,18 @@ | ||
| 781 | 671 | { |
| 782 | 672 | "include": "#comment" |
| 783 | 673 | }, |
| 784 | 674 | { |
| 675 | + "include": "#boolean" | |
| 676 | + }, | |
| 677 | + { | |
| 678 | + "include": "#numeric_literal" | |
| 679 | + }, | |
| 680 | + { | |
| 785 | 681 | "include": "#pipeline" |
| 786 | 682 | }, |
| 787 | 683 | { |
| 788 | - "include": "#normal_statement_seperator" | |
| 684 | + "include": "#statement_seperator" | |
| 789 | 685 | }, |
| 790 | 686 | { |
| 791 | 687 | "include": "#logical_expression_double" |
| 792 | 688 | }, |
| @@ -799,11 +695,14 @@ | ||
| 799 | 695 | { |
| 800 | 696 | "include": "#loop" |
| 801 | 697 | }, |
| 802 | 698 | { |
| 803 | - "include": "#function_definition" | |
| 699 | + "include": "#string" | |
| 804 | 700 | }, |
| 805 | 701 | { |
| 702 | + "include": "#function-definition" | |
| 703 | + }, | |
| 704 | + { | |
| 806 | 705 | "include": "#variable" |
| 807 | 706 | }, |
| 808 | 707 | { |
| 809 | 708 | "include": "#interpolation" |
| @@ -826,12 +725,12 @@ | ||
| 826 | 725 | { |
| 827 | 726 | "include": "#alias_statement" |
| 828 | 727 | }, |
| 829 | 728 | { |
| 830 | - "include": "#normal_statement" | |
| 729 | + "include": "#assignment" | |
| 831 | 730 | }, |
| 832 | 731 | { |
| 833 | - "include": "#string" | |
| 732 | + "include": "#command_call" | |
| 834 | 733 | }, |
| 835 | 734 | { |
| 836 | 735 | "include": "#support" |
| 837 | 736 | } |
| @@ -951,10 +850,14 @@ | ||
| 951 | 850 | }, |
| 952 | 851 | "keyword": { |
| 953 | 852 | "patterns": [ |
| 954 | 853 | { |
| 955 | - "match": "(?<=^|;|&| |\\t)(?:continue|foreach|return|select|repeat|break|until|while|case|done|elif|else|esac|then|for|end|do|if|fi|in)(?= |\\t|;|&|$)", | |
| 854 | + "match": "(?<=^|;|&|\\s)(?:then|else|elif|fi|for|in|do|done|select|case|continue|esac|while|until|return)(?=\\s|;|&|$)", | |
| 956 | 855 | "name": "keyword.control.$0.shell" |
| 856 | + }, | |
| 857 | + { | |
| 858 | + "match": "(?<=^|;|&|\\s)(?:export|declare|typeset|local|readonly)(?=\\s|;|&|$)", | |
| 859 | + "name": "storage.modifier.$0.shell" | |
| 957 | 860 | } |
| 958 | 861 | ] |
| 959 | 862 | }, |
| 960 | 863 | "line_comment": { |
| @@ -1010,11 +913,8 @@ | ||
| 1010 | 913 | { |
| 1011 | 914 | "include": "#boolean" |
| 1012 | 915 | }, |
| 1013 | 916 | { |
| 1014 | - "include": "#redirect_number" | |
| 1015 | - }, | |
| 1016 | - { | |
| 1017 | 917 | "include": "#numeric_literal" |
| 1018 | 918 | }, |
| 1019 | 919 | { |
| 1020 | 920 | "include": "#pipeline" |
| @@ -1019,9 +919,9 @@ | ||
| 1019 | 919 | { |
| 1020 | 920 | "include": "#pipeline" |
| 1021 | 921 | }, |
| 1022 | 922 | { |
| 1023 | - "include": "#normal_statement_seperator" | |
| 923 | + "include": "#statement_seperator" | |
| 1024 | 924 | }, |
| 1025 | 925 | { |
| 1026 | 926 | "include": "#string" |
| 1027 | 927 | }, |
| @@ -1063,9 +963,57 @@ | ||
| 1063 | 963 | }, |
| 1064 | 964 | "name": "meta.scope.logical-expression.shell", |
| 1065 | 965 | "patterns": [ |
| 1066 | 966 | { |
| 1067 | - "include": "#logical_expression_context" | |
| 967 | + "include": "#regex_comparison" | |
| 968 | + }, | |
| 969 | + { | |
| 970 | + "include": "#logical-expression" | |
| 971 | + }, | |
| 972 | + { | |
| 973 | + "include": "#logical_expression_single" | |
| 974 | + }, | |
| 975 | + { | |
| 976 | + "include": "#logical_expression_double" | |
| 977 | + }, | |
| 978 | + { | |
| 979 | + "include": "#comment" | |
| 980 | + }, | |
| 981 | + { | |
| 982 | + "include": "#boolean" | |
| 983 | + }, | |
| 984 | + { | |
| 985 | + "include": "#numeric_literal" | |
| 986 | + }, | |
| 987 | + { | |
| 988 | + "include": "#pipeline" | |
| 989 | + }, | |
| 990 | + { | |
| 991 | + "include": "#statement_seperator" | |
| 992 | + }, | |
| 993 | + { | |
| 994 | + "include": "#string" | |
| 995 | + }, | |
| 996 | + { | |
| 997 | + "include": "#variable" | |
| 998 | + }, | |
| 999 | + { | |
| 1000 | + "include": "#interpolation" | |
| 1001 | + }, | |
| 1002 | + { | |
| 1003 | + "include": "#heredoc" | |
| 1004 | + }, | |
| 1005 | + { | |
| 1006 | + "include": "#herestring" | |
| 1007 | + }, | |
| 1008 | + { | |
| 1009 | + "include": "#pathname" | |
| 1010 | + }, | |
| 1011 | + { | |
| 1012 | + "include": "#keyword" | |
| 1013 | + }, | |
| 1014 | + { | |
| 1015 | + "include": "#support" | |
| 1068 | 1016 | } |
| 1069 | 1017 | ] |
| 1070 | 1018 | }, |
| 1071 | 1019 | "logical_expression_single": { |
| @@ -1083,9 +1031,57 @@ | ||
| 1083 | 1031 | }, |
| 1084 | 1032 | "name": "meta.scope.logical-expression.shell", |
| 1085 | 1033 | "patterns": [ |
| 1086 | 1034 | { |
| 1087 | - "include": "#logical_expression_context" | |
| 1035 | + "include": "#regex_comparison" | |
| 1036 | + }, | |
| 1037 | + { | |
| 1038 | + "include": "#logical-expression" | |
| 1039 | + }, | |
| 1040 | + { | |
| 1041 | + "include": "#logical_expression_single" | |
| 1042 | + }, | |
| 1043 | + { | |
| 1044 | + "include": "#logical_expression_double" | |
| 1045 | + }, | |
| 1046 | + { | |
| 1047 | + "include": "#comment" | |
| 1048 | + }, | |
| 1049 | + { | |
| 1050 | + "include": "#boolean" | |
| 1051 | + }, | |
| 1052 | + { | |
| 1053 | + "include": "#numeric_literal" | |
| 1054 | + }, | |
| 1055 | + { | |
| 1056 | + "include": "#pipeline" | |
| 1057 | + }, | |
| 1058 | + { | |
| 1059 | + "include": "#statement_seperator" | |
| 1060 | + }, | |
| 1061 | + { | |
| 1062 | + "include": "#string" | |
| 1063 | + }, | |
| 1064 | + { | |
| 1065 | + "include": "#variable" | |
| 1066 | + }, | |
| 1067 | + { | |
| 1068 | + "include": "#interpolation" | |
| 1069 | + }, | |
| 1070 | + { | |
| 1071 | + "include": "#heredoc" | |
| 1072 | + }, | |
| 1073 | + { | |
| 1074 | + "include": "#herestring" | |
| 1075 | + }, | |
| 1076 | + { | |
| 1077 | + "include": "#pathname" | |
| 1078 | + }, | |
| 1079 | + { | |
| 1080 | + "include": "#keyword" | |
| 1081 | + }, | |
| 1082 | + { | |
| 1083 | + "include": "#support" | |
| 1088 | 1084 | } |
| 1089 | 1085 | ] |
| 1090 | 1086 | }, |
| 1091 | 1087 | "loop": { |
| @@ -1319,12 +1315,12 @@ | ||
| 1319 | 1315 | } |
| 1320 | 1316 | ] |
| 1321 | 1317 | }, |
| 1322 | 1318 | { |
| 1323 | - "begin": "(?<![^ \\t])({)", | |
| 1319 | + "begin": "{", | |
| 1324 | 1320 | "end": "}", |
| 1325 | 1321 | "beginCaptures": { |
| 1326 | - "1": { | |
| 1322 | + "0": { | |
| 1327 | 1323 | "name": "punctuation.definition.group.shell" |
| 1328 | 1324 | } |
| 1329 | 1325 | }, |
| 1330 | 1326 | "endCaptures": { |
| @@ -1340,208 +1336,262 @@ | ||
| 1340 | 1336 | ] |
| 1341 | 1337 | } |
| 1342 | 1338 | ] |
| 1343 | 1339 | }, |
| 1344 | - "modifiers": { | |
| 1345 | - "match": "(?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$)", | |
| 1346 | - "name": "storage.modifier.$0.shell" | |
| 1347 | - }, | |
| 1348 | - "normal_statement": { | |
| 1349 | - "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\\$)", | |
| 1350 | - "end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", | |
| 1351 | - "beginCaptures": {}, | |
| 1352 | - "endCaptures": {}, | |
| 1353 | - "name": "meta.statement.shell", | |
| 1354 | - "patterns": [ | |
| 1355 | - { | |
| 1356 | - "include": "#function_definition" | |
| 1357 | - }, | |
| 1358 | - { | |
| 1359 | - "include": "#assignment" | |
| 1360 | - }, | |
| 1361 | - { | |
| 1362 | - "begin": "[ \\t]*+(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!foreach\\b(?!\\/)|select\\b(?!\\/)|repeat\\b(?!\\/)|until\\b(?!\\/)|while\\b(?!\\/)|case\\b(?!\\/)|done\\b(?!\\/)|elif\\b(?!\\/)|else\\b(?!\\/)|esac\\b(?!\\/)|then\\b(?!\\/)|for\\b(?!\\/)|end\\b(?!\\/)|in\\b(?!\\/)|fi\\b(?!\\/)|do\\b(?!\\/)|if\\b(?!\\/))(?!\\\\\\n?$)", | |
| 1363 | - "end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)", | |
| 1364 | - "beginCaptures": {}, | |
| 1365 | - "endCaptures": {}, | |
| 1366 | - "name": "meta.statement.command.shell", | |
| 1340 | + "numeric_literal": { | |
| 1341 | + "match": "(?<!\\w)((?<!\\w)\\.?\\d(?:(?:[0-9a-zA-Z_\\.]|')|(?<=[eEpP])[+-])*)(?!\\w)", | |
| 1342 | + "captures": { | |
| 1343 | + "1": { | |
| 1367 | 1344 | "patterns": [ |
| 1368 | 1345 | { |
| 1369 | - "begin": "\\G", | |
| 1370 | - "end": "(?= |\\t|;|\\||&|$|\\n|\\)|\\`)", | |
| 1346 | + "begin": "(?=.)", | |
| 1347 | + "end": "$", | |
| 1371 | 1348 | "beginCaptures": {}, |
| 1372 | 1349 | "endCaptures": {}, |
| 1373 | - "name": "meta.statement.command.name.shell", | |
| 1374 | 1350 | "patterns": [ |
| 1375 | 1351 | { |
| 1376 | - "include": "#modifiers" | |
| 1352 | + "match": "(\\G0[xX])([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)?((?:(?<=[0-9a-fA-F])\\.|\\.(?=[0-9a-fA-F])))([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)?(?:(?<!')([pP])((?:\\+)?)((?:\\-)?)([0-9](?:[0-9]|(?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))*))?([lLfF](?!\\w))?$", | |
| 1353 | + "captures": { | |
| 1354 | + "1": { | |
| 1355 | + "name": "keyword.other.unit.hexadecimal.shell" | |
| 1356 | + }, | |
| 1357 | + "2": { | |
| 1358 | + "name": "constant.numeric.hexadecimal.shell", | |
| 1359 | + "patterns": [ | |
| 1360 | + { | |
| 1361 | + "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])", | |
| 1362 | + "name": "punctuation.separator.constant.numeric.shell" | |
| 1363 | + } | |
| 1364 | + ] | |
| 1365 | + }, | |
| 1366 | + "3": { | |
| 1367 | + "name": "punctuation.separator.constant.numeric.shell" | |
| 1368 | + }, | |
| 1369 | + "4": { | |
| 1370 | + "name": "constant.numeric.hexadecimal.shell" | |
| 1371 | + }, | |
| 1372 | + "5": { | |
| 1373 | + "name": "constant.numeric.hexadecimal.shell", | |
| 1374 | + "patterns": [ | |
| 1375 | + { | |
| 1376 | + "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])", | |
| 1377 | + "name": "punctuation.separator.constant.numeric.shell" | |
| 1378 | + } | |
| 1379 | + ] | |
| 1380 | + }, | |
| 1381 | + "6": { | |
| 1382 | + "name": "punctuation.separator.constant.numeric.shell" | |
| 1383 | + }, | |
| 1384 | + "7": { | |
| 1385 | + "name": "keyword.other.unit.exponent.hexadecimal.shell" | |
| 1386 | + }, | |
| 1387 | + "8": { | |
| 1388 | + "name": "keyword.operator.plus.exponent.hexadecimal.shell" | |
| 1389 | + }, | |
| 1390 | + "9": { | |
| 1391 | + "name": "keyword.operator.minus.exponent.hexadecimal.shell" | |
| 1392 | + }, | |
| 1393 | + "10": { | |
| 1394 | + "name": "constant.numeric.exponent.hexadecimal.shell", | |
| 1395 | + "patterns": [ | |
| 1396 | + { | |
| 1397 | + "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])", | |
| 1398 | + "name": "punctuation.separator.constant.numeric.shell" | |
| 1399 | + } | |
| 1400 | + ] | |
| 1401 | + }, | |
| 1402 | + "11": { | |
| 1403 | + "name": "keyword.other.unit.suffix.floating-point.shell" | |
| 1404 | + } | |
| 1405 | + } | |
| 1377 | 1406 | }, |
| 1378 | 1407 | { |
| 1379 | - "match": "(?<!\\w)(?:continue|return|break)(?!\\w)", | |
| 1380 | - "name": "entity.name.function.call.shell entity.name.command.shell keyword.control.$0.shell" | |
| 1408 | + "match": "\\G(?=[0-9.])(?!0[xXbB])([0-9](?:[0-9]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)?((?:(?<=[0-9])\\.|\\.(?=[0-9])))([0-9](?:[0-9]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)?(?:(?<!')([eE])((?:\\+)?)((?:\\-)?)([0-9](?:[0-9]|(?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))*))?([lLfF](?!\\w))?$", | |
| 1409 | + "captures": { | |
| 1410 | + "1": { | |
| 1411 | + "name": "constant.numeric.decimal.shell", | |
| 1412 | + "patterns": [ | |
| 1413 | + { | |
| 1414 | + "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])", | |
| 1415 | + "name": "punctuation.separator.constant.numeric.shell" | |
| 1416 | + } | |
| 1417 | + ] | |
| 1418 | + }, | |
| 1419 | + "2": { | |
| 1420 | + "name": "punctuation.separator.constant.numeric.shell" | |
| 1421 | + }, | |
| 1422 | + "3": { | |
| 1423 | + "name": "constant.numeric.decimal.point.shell" | |
| 1424 | + }, | |
| 1425 | + "4": { | |
| 1426 | + "name": "constant.numeric.decimal.shell", | |
| 1427 | + "patterns": [ | |
| 1428 | + { | |
| 1429 | + "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])", | |
| 1430 | + "name": "punctuation.separator.constant.numeric.shell" | |
| 1431 | + } | |
| 1432 | + ] | |
| 1433 | + }, | |
| 1434 | + "5": { | |
| 1435 | + "name": "punctuation.separator.constant.numeric.shell" | |
| 1436 | + }, | |
| 1437 | + "6": { | |
| 1438 | + "name": "keyword.other.unit.exponent.decimal.shell" | |
| 1439 | + }, | |
| 1440 | + "7": { | |
| 1441 | + "name": "keyword.operator.plus.exponent.decimal.shell" | |
| 1442 | + }, | |
| 1443 | + "8": { | |
| 1444 | + "name": "keyword.operator.minus.exponent.decimal.shell" | |
| 1445 | + }, | |
| 1446 | + "9": { | |
| 1447 | + "name": "constant.numeric.exponent.decimal.shell", | |
| 1448 | + "patterns": [ | |
| 1449 | + { | |
| 1450 | + "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])", | |
| 1451 | + "name": "punctuation.separator.constant.numeric.shell" | |
| 1452 | + } | |
| 1453 | + ] | |
| 1454 | + }, | |
| 1455 | + "10": { | |
| 1456 | + "name": "keyword.other.unit.suffix.floating-point.shell" | |
| 1457 | + } | |
| 1458 | + } | |
| 1381 | 1459 | }, |
| 1382 | 1460 | { |
| 1383 | - "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)", | |
| 1384 | - "name": "entity.name.function.call.shell entity.name.command.shell support.function.builtin.shell" | |
| 1461 | + "match": "(\\G0[bB])([01](?:[01]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)((?:[uU]|(?:[uU]ll?)|(?:[uU]LL?)|(?:ll?[uU]?)|(?:LL?[uU]?)|[fF])(?!\\w))?$", | |
| 1462 | + "captures": { | |
| 1463 | + "1": { | |
| 1464 | + "name": "keyword.other.unit.binary.shell" | |
| 1465 | + }, | |
| 1466 | + "2": { | |
| 1467 | + "name": "constant.numeric.binary.shell", | |
| 1468 | + "patterns": [ | |
| 1469 | + { | |
| 1470 | + "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])", | |
| 1471 | + "name": "punctuation.separator.constant.numeric.shell" | |
| 1472 | + } | |
| 1473 | + ] | |
| 1474 | + }, | |
| 1475 | + "3": { | |
| 1476 | + "name": "punctuation.separator.constant.numeric.shell" | |
| 1477 | + }, | |
| 1478 | + "4": { | |
| 1479 | + "name": "keyword.other.unit.suffix.integer.shell" | |
| 1480 | + } | |
| 1481 | + } | |
| 1385 | 1482 | }, |
| 1386 | 1483 | { |
| 1387 | - "include": "#variable" | |
| 1484 | + "match": "(\\G0)((?:[0-7]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))+)((?:[uU]|(?:[uU]ll?)|(?:[uU]LL?)|(?:ll?[uU]?)|(?:LL?[uU]?)|[fF])(?!\\w))?$", | |
| 1485 | + "captures": { | |
| 1486 | + "1": { | |
| 1487 | + "name": "keyword.other.unit.octal.shell" | |
| 1488 | + }, | |
| 1489 | + "2": { | |
| 1490 | + "name": "constant.numeric.octal.shell", | |
| 1491 | + "patterns": [ | |
| 1492 | + { | |
| 1493 | + "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])", | |
| 1494 | + "name": "punctuation.separator.constant.numeric.shell" | |
| 1495 | + } | |
| 1496 | + ] | |
| 1497 | + }, | |
| 1498 | + "3": { | |
| 1499 | + "name": "punctuation.separator.constant.numeric.shell" | |
| 1500 | + }, | |
| 1501 | + "4": { | |
| 1502 | + "name": "keyword.other.unit.suffix.integer.shell" | |
| 1503 | + } | |
| 1504 | + } | |
| 1388 | 1505 | }, |
| 1389 | 1506 | { |
| 1390 | - "match": "(?<=\\G|'|\"|\\}|\\))([^ \\n\\t\\r\"'=;&\\|`\\)\\{]+)", | |
| 1507 | + "match": "(\\G0[xX])([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)(?:(?<!')([pP])((?:\\+)?)((?:\\-)?)([0-9](?:[0-9]|(?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))*))?((?:[uU]|(?:[uU]ll?)|(?:[uU]LL?)|(?:ll?[uU]?)|(?:LL?[uU]?)|[fF])(?!\\w))?$", | |
| 1391 | 1508 | "captures": { |
| 1392 | 1509 | "1": { |
| 1393 | - "name": "entity.name.function.call.shell entity.name.command.shell" | |
| 1510 | + "name": "keyword.other.unit.hexadecimal.shell" | |
| 1511 | + }, | |
| 1512 | + "2": { | |
| 1513 | + "name": "constant.numeric.hexadecimal.shell", | |
| 1514 | + "patterns": [ | |
| 1515 | + { | |
| 1516 | + "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])", | |
| 1517 | + "name": "punctuation.separator.constant.numeric.shell" | |
| 1518 | + } | |
| 1519 | + ] | |
| 1520 | + }, | |
| 1521 | + "3": { | |
| 1522 | + "name": "punctuation.separator.constant.numeric.shell" | |
| 1523 | + }, | |
| 1524 | + "4": { | |
| 1525 | + "name": "keyword.other.unit.exponent.hexadecimal.shell" | |
| 1526 | + }, | |
| 1527 | + "5": { | |
| 1528 | + "name": "keyword.operator.plus.exponent.hexadecimal.shell" | |
| 1529 | + }, | |
| 1530 | + "6": { | |
| 1531 | + "name": "keyword.operator.minus.exponent.hexadecimal.shell" | |
| 1532 | + }, | |
| 1533 | + "7": { | |
| 1534 | + "name": "constant.numeric.exponent.hexadecimal.shell", | |
| 1535 | + "patterns": [ | |
| 1536 | + { | |
| 1537 | + "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])", | |
| 1538 | + "name": "punctuation.separator.constant.numeric.shell" | |
| 1539 | + } | |
| 1540 | + ] | |
| 1541 | + }, | |
| 1542 | + "8": { | |
| 1543 | + "name": "keyword.other.unit.suffix.integer.shell" | |
| 1394 | 1544 | } |
| 1395 | 1545 | } |
| 1396 | 1546 | }, |
| 1397 | 1547 | { |
| 1398 | - "begin": "(?:\\G|(?<! |\\t|;|\\||&|\\n|\\{|#))((?:\\$)?)((?:(\")|(')))", | |
| 1399 | - "end": "(?<!\\G)(?<=(?:\\2))", | |
| 1400 | - "beginCaptures": { | |
| 1548 | + "match": "\\G(?=[0-9.])(?!0[xXbB])([0-9](?:[0-9]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)(?:(?<!')([eE])((?:\\+)?)((?:\\-)?)([0-9](?:[0-9]|(?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))*))?((?:[uU]|(?:[uU]ll?)|(?:[uU]LL?)|(?:ll?[uU]?)|(?:LL?[uU]?)|[fF])(?!\\w))?$", | |
| 1549 | + "captures": { | |
| 1401 | 1550 | "1": { |
| 1402 | - "name": "meta.statement.command.name.quoted.shell punctuation.definition.string.shell entity.name.function.call.shell entity.name.command.shell" | |
| 1551 | + "name": "constant.numeric.decimal.shell", | |
| 1552 | + "patterns": [ | |
| 1553 | + { | |
| 1554 | + "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])", | |
| 1555 | + "name": "punctuation.separator.constant.numeric.shell" | |
| 1556 | + } | |
| 1557 | + ] | |
| 1403 | 1558 | }, |
| 1404 | - "2": {}, | |
| 1559 | + "2": { | |
| 1560 | + "name": "punctuation.separator.constant.numeric.shell" | |
| 1561 | + }, | |
| 1405 | 1562 | "3": { |
| 1406 | - "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" | |
| 1563 | + "name": "keyword.other.unit.exponent.decimal.shell" | |
| 1407 | 1564 | }, |
| 1408 | 1565 | "4": { |
| 1409 | - "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" | |
| 1410 | - } | |
| 1411 | - }, | |
| 1412 | - "endCaptures": {}, | |
| 1413 | - "patterns": [ | |
| 1414 | - { | |
| 1415 | - "include": "#continuation_of_single_quoted_command_name" | |
| 1566 | + "name": "keyword.operator.plus.exponent.decimal.shell" | |
| 1416 | 1567 | }, |
| 1417 | - { | |
| 1418 | - "include": "#continuation_of_double_quoted_command_name" | |
| 1568 | + "5": { | |
| 1569 | + "name": "keyword.operator.minus.exponent.decimal.shell" | |
| 1570 | + }, | |
| 1571 | + "6": { | |
| 1572 | + "name": "constant.numeric.exponent.decimal.shell", | |
| 1573 | + "patterns": [ | |
| 1574 | + { | |
| 1575 | + "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])", | |
| 1576 | + "name": "punctuation.separator.constant.numeric.shell" | |
| 1577 | + } | |
| 1578 | + ] | |
| 1579 | + }, | |
| 1580 | + "7": { | |
| 1581 | + "name": "keyword.other.unit.suffix.integer.shell" | |
| 1419 | 1582 | } |
| 1420 | - ] | |
| 1421 | - }, | |
| 1422 | - { | |
| 1423 | - "include": "#line_continuation" | |
| 1583 | + } | |
| 1424 | 1584 | } |
| 1425 | 1585 | ] |
| 1426 | - }, | |
| 1427 | - { | |
| 1428 | - "include": "#line_continuation" | |
| 1429 | - }, | |
| 1430 | - { | |
| 1431 | - "include": "#option" | |
| 1432 | - }, | |
| 1433 | - { | |
| 1434 | - "include": "#argument" | |
| 1435 | - }, | |
| 1436 | - { | |
| 1437 | - "include": "#statement_context" | |
| 1438 | - }, | |
| 1439 | - { | |
| 1440 | - "include": "#string" | |
| 1441 | 1586 | } |
| 1442 | 1587 | ] |
| 1443 | - }, | |
| 1444 | - { | |
| 1445 | - "include": "#line_continuation" | |
| 1446 | - }, | |
| 1447 | - { | |
| 1448 | - "include": "#normal_statement_context" | |
| 1449 | 1588 | } |
| 1450 | - ] | |
| 1451 | - }, | |
| 1452 | - "normal_statement_context": { | |
| 1453 | - "patterns": [ | |
| 1454 | - { | |
| 1455 | - "include": "#comment" | |
| 1456 | - }, | |
| 1457 | - { | |
| 1458 | - "include": "#pipeline" | |
| 1459 | - }, | |
| 1460 | - { | |
| 1461 | - "include": "#normal_statement_seperator" | |
| 1462 | - }, | |
| 1463 | - { | |
| 1464 | - "include": "#misc_ranges" | |
| 1465 | - }, | |
| 1466 | - { | |
| 1467 | - "include": "#boolean" | |
| 1468 | - }, | |
| 1469 | - { | |
| 1470 | - "include": "#redirect_number" | |
| 1471 | - }, | |
| 1472 | - { | |
| 1473 | - "include": "#numeric_literal" | |
| 1474 | - }, | |
| 1475 | - { | |
| 1476 | - "include": "#string" | |
| 1477 | - }, | |
| 1478 | - { | |
| 1479 | - "include": "#variable" | |
| 1480 | - }, | |
| 1481 | - { | |
| 1482 | - "include": "#interpolation" | |
| 1483 | - }, | |
| 1484 | - { | |
| 1485 | - "include": "#heredoc" | |
| 1486 | - }, | |
| 1487 | - { | |
| 1488 | - "include": "#herestring" | |
| 1489 | - }, | |
| 1490 | - { | |
| 1491 | - "include": "#redirection" | |
| 1492 | - }, | |
| 1493 | - { | |
| 1494 | - "include": "#pathname" | |
| 1495 | - }, | |
| 1496 | - { | |
| 1497 | - "include": "#keyword" | |
| 1498 | - }, | |
| 1499 | - { | |
| 1500 | - "include": "#support" | |
| 1501 | - } | |
| 1502 | - ] | |
| 1503 | - }, | |
| 1504 | - "normal_statement_seperator": { | |
| 1505 | - "match": "(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n)", | |
| 1506 | - "captures": { | |
| 1507 | - "1": { | |
| 1508 | - "name": "punctuation.terminator.statement.semicolon.shell" | |
| 1509 | - }, | |
| 1510 | - "2": { | |
| 1511 | - "name": "punctuation.separator.statement.and.shell" | |
| 1512 | - }, | |
| 1513 | - "3": { | |
| 1514 | - "name": "punctuation.separator.statement.or.shell" | |
| 1515 | - }, | |
| 1516 | - "4": { | |
| 1517 | - "name": "punctuation.separator.statement.background.shell" | |
| 1518 | - } | |
| 1519 | 1589 | } |
| 1520 | 1590 | }, |
| 1521 | - "numeric_literal": { | |
| 1522 | - "match": "[ \\t]*+(?<==| |\\t|^|\\{|\\(|\\[)(?:(?:(?:(?:(0[xX][0-9A-Fa-f]+)|(0\\d+))|(\\d{1,2}#[0-9a-zA-Z@_]+))|(-?\\d+\\.\\d+))|(-?\\d+))(?!>)", | |
| 1523 | - "captures": { | |
| 1524 | - "1": { | |
| 1525 | - "name": "constant.numeric.shell constant.numeric.hex.shell" | |
| 1526 | - }, | |
| 1527 | - "2": { | |
| 1528 | - "name": "constant.numeric.shell constant.numeric.octal.shell" | |
| 1529 | - }, | |
| 1530 | - "3": { | |
| 1531 | - "name": "constant.numeric.shell constant.numeric.other.shell" | |
| 1532 | - }, | |
| 1533 | - "4": { | |
| 1534 | - "name": "constant.numeric.shell constant.numeric.integer.shell" | |
| 1535 | - }, | |
| 1536 | - "5": { | |
| 1537 | - "name": "constant.numeric.shell constant.numeric.integer.shell" | |
| 1538 | - } | |
| 1539 | - } | |
| 1540 | - }, | |
| 1541 | 1591 | "option": { |
| 1542 | - "begin": "[ \\t]++(-)((?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t])))", | |
| 1543 | - "end": "(?:(?=[ \\t])|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\))", | |
| 1592 | + "begin": "\\s++(-)((?!(?:!|%|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|\\s)))", | |
| 1593 | + "end": "(?:(?=\\s)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<!\\\\))", | |
| 1544 | 1594 | "beginCaptures": { |
| 1545 | 1595 | "1": { |
| 1546 | 1596 | "name": "string.unquoted.argument.shell constant.other.option.dash.shell" |
| 1547 | 1597 | }, |
| @@ -1637,22 +1687,8 @@ | ||
| 1637 | 1687 | "name": "keyword.operator.pipe.shell" |
| 1638 | 1688 | } |
| 1639 | 1689 | ] |
| 1640 | 1690 | }, |
| 1641 | - "redirect_number": { | |
| 1642 | - "match": "(?<=[ \\t])(?:(1)|(2)|(\\d+))(?=>)", | |
| 1643 | - "captures": { | |
| 1644 | - "1": { | |
| 1645 | - "name": "keyword.operator.redirect.stdout.shell" | |
| 1646 | - }, | |
| 1647 | - "2": { | |
| 1648 | - "name": "keyword.operator.redirect.stderr.shell" | |
| 1649 | - }, | |
| 1650 | - "3": { | |
| 1651 | - "name": "keyword.operator.redirect.$3.shell" | |
| 1652 | - } | |
| 1653 | - } | |
| 1654 | - }, | |
| 1655 | 1691 | "redirection": { |
| 1656 | 1692 | "patterns": [ |
| 1657 | 1693 | { |
| 1658 | 1694 | "begin": "[><]\\(", |
| @@ -1691,14 +1727,14 @@ | ||
| 1691 | 1727 | } |
| 1692 | 1728 | ] |
| 1693 | 1729 | }, |
| 1694 | 1730 | "simple_options": { |
| 1695 | - "match": "(?:[ \\t]++\\-\\w+)*", | |
| 1731 | + "match": "(?:\\s++\\-\\w+)*", | |
| 1696 | 1732 | "captures": { |
| 1697 | 1733 | "0": { |
| 1698 | 1734 | "patterns": [ |
| 1699 | 1735 | { |
| 1700 | - "match": "[ \\t]++(\\-)(\\w+)", | |
| 1736 | + "match": "\\s++(\\-)(\\w+)", | |
| 1701 | 1737 | "captures": { |
| 1702 | 1738 | "1": { |
| 1703 | 1739 | "name": "string.unquoted.argument.shell constant.other.option.dash.shell" |
| 1704 | 1740 | }, |
| @@ -1710,68 +1746,67 @@ | ||
| 1710 | 1746 | ] |
| 1711 | 1747 | } |
| 1712 | 1748 | } |
| 1713 | 1749 | }, |
| 1714 | - "start_of_command": { | |
| 1715 | - "match": "[ \\t]*+(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!foreach\\b(?!\\/)|select\\b(?!\\/)|repeat\\b(?!\\/)|until\\b(?!\\/)|while\\b(?!\\/)|case\\b(?!\\/)|done\\b(?!\\/)|elif\\b(?!\\/)|else\\b(?!\\/)|esac\\b(?!\\/)|then\\b(?!\\/)|for\\b(?!\\/)|end\\b(?!\\/)|in\\b(?!\\/)|fi\\b(?!\\/)|do\\b(?!\\/)|if\\b(?!\\/))(?!\\\\\\n?$)" | |
| 1716 | - }, | |
| 1717 | - "start_of_double_quoted_command_name": { | |
| 1718 | - "match": "(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?:[ \\t]*+([^ \t\n'&;<>\\(\\)\\$`\\\\\"\\|]+(?!>)))?(?:(?:\\$\")|\")", | |
| 1719 | - "captures": { | |
| 1720 | - "1": { | |
| 1721 | - "name": "entity.name.function.call.shell entity.name.command.shell", | |
| 1722 | - "patterns": [ | |
| 1723 | - { | |
| 1724 | - "match": "\\*", | |
| 1725 | - "name": "variable.language.special.wildcard.shell" | |
| 1726 | - }, | |
| 1727 | - { | |
| 1728 | - "include": "#variable" | |
| 1729 | - }, | |
| 1730 | - { | |
| 1731 | - "include": "#numeric_literal" | |
| 1732 | - }, | |
| 1733 | - { | |
| 1734 | - "match": "(?<!\\w)(\\b(?:true|false)\\b)(?!\\w)", | |
| 1735 | - "captures": { | |
| 1736 | - "1": { | |
| 1737 | - "name": "constant.language.$1.shell" | |
| 1738 | - } | |
| 1739 | - } | |
| 1740 | - } | |
| 1741 | - ] | |
| 1750 | + "statement_context": { | |
| 1751 | + "patterns": [ | |
| 1752 | + { | |
| 1753 | + "include": "#comment" | |
| 1754 | + }, | |
| 1755 | + { | |
| 1756 | + "include": "#pipeline" | |
| 1757 | + }, | |
| 1758 | + { | |
| 1759 | + "include": "#statement_seperator" | |
| 1760 | + }, | |
| 1761 | + { | |
| 1762 | + "include": "#misc_ranges" | |
| 1763 | + }, | |
| 1764 | + { | |
| 1765 | + "include": "#string" | |
| 1766 | + }, | |
| 1767 | + { | |
| 1768 | + "include": "#variable" | |
| 1769 | + }, | |
| 1770 | + { | |
| 1771 | + "include": "#interpolation" | |
| 1772 | + }, | |
| 1773 | + { | |
| 1774 | + "include": "#heredoc" | |
| 1775 | + }, | |
| 1776 | + { | |
| 1777 | + "include": "#herestring" | |
| 1778 | + }, | |
| 1779 | + { | |
| 1780 | + "include": "#redirection" | |
| 1781 | + }, | |
| 1782 | + { | |
| 1783 | + "include": "#pathname" | |
| 1784 | + }, | |
| 1785 | + { | |
| 1786 | + "include": "#keyword" | |
| 1787 | + }, | |
| 1788 | + { | |
| 1789 | + "include": "#support" | |
| 1742 | 1790 | } |
| 1743 | - }, | |
| 1744 | - "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" | |
| 1791 | + ] | |
| 1745 | 1792 | }, |
| 1746 | - "start_of_single_quoted_command_name": { | |
| 1747 | - "match": "(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?:[ \\t]*+([^ \t\n'&;<>\\(\\)\\$`\\\\\"\\|]+(?!>)))?(?:(?:\\$')|')", | |
| 1793 | + "statement_seperator": { | |
| 1794 | + "match": "(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n)", | |
| 1748 | 1795 | "captures": { |
| 1749 | 1796 | "1": { |
| 1750 | - "name": "entity.name.function.call.shell entity.name.command.shell", | |
| 1751 | - "patterns": [ | |
| 1752 | - { | |
| 1753 | - "match": "\\*", | |
| 1754 | - "name": "variable.language.special.wildcard.shell" | |
| 1755 | - }, | |
| 1756 | - { | |
| 1757 | - "include": "#variable" | |
| 1758 | - }, | |
| 1759 | - { | |
| 1760 | - "include": "#numeric_literal" | |
| 1761 | - }, | |
| 1762 | - { | |
| 1763 | - "match": "(?<!\\w)(\\b(?:true|false)\\b)(?!\\w)", | |
| 1764 | - "captures": { | |
| 1765 | - "1": { | |
| 1766 | - "name": "constant.language.$1.shell" | |
| 1767 | - } | |
| 1768 | - } | |
| 1769 | - } | |
| 1770 | - ] | |
| 1797 | + "name": "punctuation.terminator.statement.semicolon.shell" | |
| 1798 | + }, | |
| 1799 | + "2": { | |
| 1800 | + "name": "punctuation.separator.statement.and.shell" | |
| 1801 | + }, | |
| 1802 | + "3": { | |
| 1803 | + "name": "punctuation.separator.statement.or.shell" | |
| 1804 | + }, | |
| 1805 | + "4": { | |
| 1806 | + "name": "punctuation.separator.statement.background.shell" | |
| 1771 | 1807 | } |
| 1772 | - }, | |
| 1773 | - "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" | |
| 1808 | + } | |
| 1774 | 1809 | }, |
| 1775 | 1810 | "string": { |
| 1776 | 1811 | "patterns": [ |
| 1777 | 1812 | { |
| @@ -1779,14 +1814,14 @@ | ||
| 1779 | 1814 | "name": "constant.character.escape.shell" |
| 1780 | 1815 | }, |
| 1781 | 1816 | { |
| 1782 | 1817 | "begin": "'", |
| 1783 | - "end": "'", | |
| 1784 | 1818 | "beginCaptures": { |
| 1785 | 1819 | "0": { |
| 1786 | 1820 | "name": "punctuation.definition.string.begin.shell" |
| 1787 | 1821 | } |
| 1788 | 1822 | }, |
| 1823 | + "end": "'", | |
| 1789 | 1824 | "endCaptures": { |
| 1790 | 1825 | "0": { |
| 1791 | 1826 | "name": "punctuation.definition.string.end.shell" |
| 1792 | 1827 | } |
| @@ -1793,15 +1828,15 @@ | ||
| 1793 | 1828 | }, |
| 1794 | 1829 | "name": "string.quoted.single.shell" |
| 1795 | 1830 | }, |
| 1796 | 1831 | { |
| 1797 | - "begin": "\\$?\"", | |
| 1798 | - "end": "\"", | |
| 1832 | + "begin": " *\\$?\"", | |
| 1799 | 1833 | "beginCaptures": { |
| 1800 | 1834 | "0": { |
| 1801 | 1835 | "name": "punctuation.definition.string.begin.shell" |
| 1802 | 1836 | } |
| 1803 | 1837 | }, |
| 1838 | + "end": "\"", | |
| 1804 | 1839 | "endCaptures": { |
| 1805 | 1840 | "0": { |
| 1806 | 1841 | "name": "punctuation.definition.string.end.shell" |
| 1807 | 1842 | } |
| @@ -1808,9 +1843,9 @@ | ||
| 1808 | 1843 | }, |
| 1809 | 1844 | "name": "string.quoted.double.shell", |
| 1810 | 1845 | "patterns": [ |
| 1811 | 1846 | { |
| 1812 | - "match": "\\\\[\\$\\n`\"\\\\]", | |
| 1847 | + "match": "\\\\[\\$`\"\\\\\\n]", | |
| 1813 | 1848 | "name": "constant.character.escape.shell" |
| 1814 | 1849 | }, |
| 1815 | 1850 | { |
| 1816 | 1851 | "include": "#variable" |
| @@ -1821,14 +1856,14 @@ | ||
| 1821 | 1856 | ] |
| 1822 | 1857 | }, |
| 1823 | 1858 | { |
| 1824 | 1859 | "begin": "\\$'", |
| 1825 | - "end": "'", | |
| 1826 | 1860 | "beginCaptures": { |
| 1827 | 1861 | "0": { |
| 1828 | 1862 | "name": "punctuation.definition.string.begin.shell" |
| 1829 | 1863 | } |
| 1830 | 1864 | }, |
| 1865 | + "end": "'", | |
| 1831 | 1866 | "endCaptures": { |
| 1832 | 1867 | "0": { |
| 1833 | 1868 | "name": "punctuation.definition.string.end.shell" |
| 1834 | 1869 | } |
| @@ -1835,21 +1870,21 @@ | ||
| 1835 | 1870 | }, |
| 1836 | 1871 | "name": "string.quoted.single.dollar.shell", |
| 1837 | 1872 | "patterns": [ |
| 1838 | 1873 | { |
| 1839 | - "match": "\\\\(?:a|b|e|f|n|r|t|v|\\\\|')", | |
| 1874 | + "match": "\\\\(a|b|e|f|n|r|t|v|\\\\|')", | |
| 1840 | 1875 | "name": "constant.character.escape.ansi-c.shell" |
| 1841 | 1876 | }, |
| 1842 | 1877 | { |
| 1843 | - "match": "\\\\[0-9]{3}\"", | |
| 1878 | + "match": "\\\\[0-9]{3}", | |
| 1844 | 1879 | "name": "constant.character.escape.octal.shell" |
| 1845 | 1880 | }, |
| 1846 | 1881 | { |
| 1847 | - "match": "\\\\x[0-9a-fA-F]{2}\"", | |
| 1882 | + "match": "\\\\x[0-9a-fA-F]{2}", | |
| 1848 | 1883 | "name": "constant.character.escape.hex.shell" |
| 1849 | 1884 | }, |
| 1850 | 1885 | { |
| 1851 | - "match": "\\\\c.\"", | |
| 1886 | + "match": "\\\\c.", | |
| 1852 | 1887 | "name": "constant.character.escape.control-char.shell" |
| 1853 | 1888 | } |
| 1854 | 1889 | ] |
| 1855 | 1890 | } |
| @@ -1854,16 +1889,8 @@ | ||
| 1854 | 1889 | ] |
| 1855 | 1890 | } |
| 1856 | 1891 | ] |
| 1857 | 1892 | }, |
| 1858 | - "support": { | |
| 1859 | - "patterns": [ | |
| 1860 | - { | |
| 1861 | - "match": "(?<=^|;|&|\\s)(?::|\\.)(?=\\s|;|&|$)", | |
| 1862 | - "name": "support.function.builtin.shell" | |
| 1863 | - } | |
| 1864 | - ] | |
| 1865 | - }, | |
| 1866 | 1893 | "variable": { |
| 1867 | 1894 | "patterns": [ |
| 1868 | 1895 | { |
| 1869 | 1896 | "match": "(\\$)(\\@(?!\\w))", |
| @@ -1887,66 +1914,28 @@ | ||
| 1887 | 1914 | } |
| 1888 | 1915 | } |
| 1889 | 1916 | }, |
| 1890 | 1917 | { |
| 1891 | - "match": "(\\$)([-*#?$!0_](?!\\w))", | |
| 1918 | + "match": "(\\$)(\\{[0-9]+\\}(?!\\w))", | |
| 1892 | 1919 | "captures": { |
| 1893 | 1920 | "1": { |
| 1894 | - "name": "punctuation.definition.variable.shell variable.language.special.shell" | |
| 1921 | + "name": "punctuation.definition.variable.shell variable.parameter.positional.shell" | |
| 1895 | 1922 | }, |
| 1896 | 1923 | "2": { |
| 1897 | - "name": "variable.language.special.shell" | |
| 1924 | + "name": "variable.parameter.positional.shell" | |
| 1898 | 1925 | } |
| 1899 | 1926 | } |
| 1900 | 1927 | }, |
| 1901 | 1928 | { |
| 1902 | - "begin": "(\\$)(\\{)[ \\t]*+(?=\\d)", | |
| 1903 | - "end": "\\}", | |
| 1904 | - "beginCaptures": { | |
| 1929 | + "match": "(\\$)([-*#?$!0_](?!\\w))", | |
| 1930 | + "captures": { | |
| 1905 | 1931 | "1": { |
| 1906 | - "name": "punctuation.definition.variable.shell variable.parameter.positional.shell" | |
| 1932 | + "name": "punctuation.definition.variable.shell variable.language.special.shell" | |
| 1907 | 1933 | }, |
| 1908 | 1934 | "2": { |
| 1909 | - "name": "punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell variable.parameter.positional.shell" | |
| 1935 | + "name": "variable.language.special.shell" | |
| 1910 | 1936 | } |
| 1911 | - }, | |
| 1912 | - "endCaptures": { | |
| 1913 | - "0": { | |
| 1914 | - "name": "punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell variable.parameter.positional.shell" | |
| 1915 | - } | |
| 1916 | - }, | |
| 1917 | - "contentName": "meta.parameter-expansion", | |
| 1918 | - "patterns": [ | |
| 1919 | - { | |
| 1920 | - "match": "!|:[-=?]?|\\*|@|##|#|%%|%|\\/", | |
| 1921 | - "name": "keyword.operator.expansion.shell" | |
| 1922 | - }, | |
| 1923 | - { | |
| 1924 | - "match": "(\\[)[^\\]]+(\\])", | |
| 1925 | - "captures": { | |
| 1926 | - "1": { | |
| 1927 | - "name": "punctuation.section.array.shell" | |
| 1928 | - }, | |
| 1929 | - "2": { | |
| 1930 | - "name": "punctuation.section.array.shell" | |
| 1931 | - } | |
| 1932 | - } | |
| 1933 | - }, | |
| 1934 | - { | |
| 1935 | - "match": "[0-9]+", | |
| 1936 | - "name": "variable.parameter.positional.shell" | |
| 1937 | - }, | |
| 1938 | - { | |
| 1939 | - "match": "(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)", | |
| 1940 | - "name": "variable.other.normal.shell" | |
| 1941 | - }, | |
| 1942 | - { | |
| 1943 | - "include": "#variable" | |
| 1944 | - }, | |
| 1945 | - { | |
| 1946 | - "include": "#string" | |
| 1947 | - } | |
| 1948 | - ] | |
| 1937 | + } | |
| 1949 | 1938 | }, |
| 1950 | 1939 | { |
| 1951 | 1940 | "begin": "(\\$)(\\{)", |
| 1952 | 1941 | "end": "\\}", |
| @@ -1951,20 +1940,19 @@ | ||
| 1951 | 1940 | "begin": "(\\$)(\\{)", |
| 1952 | 1941 | "end": "\\}", |
| 1953 | 1942 | "beginCaptures": { |
| 1954 | 1943 | "1": { |
| 1955 | - "name": "punctuation.definition.variable.shell" | |
| 1944 | + "name": "punctuation.definition.variable.shell punctuation.section.bracket.curly.variable.begin.shell" | |
| 1956 | 1945 | }, |
| 1957 | 1946 | "2": { |
| 1958 | - "name": "punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell" | |
| 1947 | + "name": "punctuation.section.bracket.curly.variable.begin.shell" | |
| 1959 | 1948 | } |
| 1960 | 1949 | }, |
| 1961 | 1950 | "endCaptures": { |
| 1962 | 1951 | "0": { |
| 1963 | - "name": "punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell" | |
| 1952 | + "name": "punctuation.section.bracket.curly.variable.end.shell" | |
| 1964 | 1953 | } |
| 1965 | 1954 | }, |
| 1966 | - "contentName": "meta.parameter-expansion", | |
| 1967 | 1955 | "patterns": [ |
| 1968 | 1956 | { |
| 1969 | 1957 | "match": "!|:[-=?]?|\\*|@|##|#|%%|%|\\/", |
| 1970 | 1958 | "name": "keyword.operator.expansion.shell" |
| @@ -1978,12 +1966,8 @@ | ||
| 1978 | 1966 | "2": { |
| 1979 | 1967 | "name": "punctuation.section.array.shell" |
| 1980 | 1968 | } |
| 1981 | 1969 | } |
| 1982 | - }, | |
| 1983 | - { | |
| 1984 | - "match": "(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)", | |
| 1985 | - "name": "variable.other.normal.shell" | |
| 1986 | 1970 | }, |
| 1987 | 1971 | { |
| 1988 | 1972 | "include": "#variable" |
| 1989 | 1973 | }, |