{ "information_for_contributors": [ "This file has been converted from https://github.com/jeff-hykin/better-shell-syntax/blob/master/autogenerated/shell.tmLanguage.json", "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/b05618771b35b4baa25661dff91170b4924fdac8", "name": "Shell Script", "scopeName": "source.shell", "patterns": [ { "include": "#initial_context" } ], "repository": { "alias_statement": { "begin": "(alias)(?:\\s)+\\s*+((?\\(\\)\\$`\\\\\"\\|]+(?!>)", "captures": { "0": { "patterns": [ { "match": "\\*", "name": "variable.language.special.wildcard.shell" }, { "include": "#variable" }, { "include": "#numeric_literal" }, { "match": "(?|#|\\n|$|;|\\s))(.+?)(?:(?=\\s)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?|#|\\n|$|;|\\s))(.+?)(?:(?=\\s)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?|&&|\\|\\|", "name": "keyword.operator.logical.shell" }, { "match": "(?[>=]?|==|!=|^|\\|{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" }, { "begin": "\\(\\(", "end": "\\)\\)", "beginCaptures": { "0": { "name": "punctuation.section.arithmetic.shell" } }, "endCaptures": { "0": { "name": "punctuation.section.arithmetic.shell" } }, "name": "meta.arithmetic.shell", "patterns": [ { "include": "#math" } ] }, { "begin": "(?|#|\\n|$|;|\\s)))", "end": "(?:(?=\\s)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|#|\\])(?<]\\(", "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": { "match": "(?:\\s++\\-\\w+)*", "captures": { "0": { "patterns": [ { "match": "\\s++(\\-)(\\w+)", "captures": { "1": { "name": "string.unquoted.argument.shell constant.other.option.dash.shell" }, "2": { "name": "string.unquoted.argument.shell constant.other.option.shell" } } } ] } } }, "statement_context": { "patterns": [ { "include": "#comment" }, { "include": "#pipeline" }, { "include": "#statement_seperator" }, { "include": "#misc_ranges" }, { "include": "#string" }, { "include": "#variable" }, { "include": "#interpolation" }, { "include": "#heredoc" }, { "include": "#herestring" }, { "include": "#redirection" }, { "include": "#pathname" }, { "include": "#keyword" }, { "include": "#support" } ] }, "statement_seperator": { "match": "(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n)", "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" } } }, "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" } ] } ] }, "variable": { "patterns": [ { "match": "(\\$)(\\@(?!\\w))", "captures": { "1": { "name": "punctuation.definition.variable.shell variable.parameter.positional.all.shell" }, "2": { "name": "variable.parameter.positional.all.shell" } } }, { "match": "(\\$)([0-9](?!\\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.parameter.positional.shell" }, "2": { "name": "variable.parameter.positional.shell" } } }, { "match": "(\\$)([-*#?$!0_](?!\\w))", "captures": { "1": { "name": "punctuation.definition.variable.shell variable.language.special.shell" }, "2": { "name": "variable.language.special.shell" } } }, { "begin": "(\\$)(\\{)", "end": "\\}", "beginCaptures": { "1": { "name": "punctuation.definition.variable.shell punctuation.section.bracket.curly.variable.begin.shell" }, "2": { "name": "punctuation.section.bracket.curly.variable.begin.shell" } }, "endCaptures": { "0": { "name": "punctuation.section.bracket.curly.variable.end.shell" } }, "patterns": [ { "match": "!|:[-=?]?|\\*|@|##|#|%%|%|\\/", "name": "keyword.operator.expansion.shell" }, { "match": "(\\[)[^\\]]+(\\])", "captures": { "1": { "name": "punctuation.section.array.shell" }, "2": { "name": "punctuation.section.array.shell" } } }, { "include": "#variable" }, { "include": "#string" } ] }, { "match": "(\\$)(\\w+(?!\\w))", "captures": { "1": { "name": "punctuation.definition.variable.shell variable.other.normal.shell" }, "2": { "name": "variable.other.normal.shell" } } } ] } } }