| 1 |
|
| 2 |
|
| 3 |
[ |
| 4 |
"&&" |
| 5 |
"||" |
| 6 |
"|" |
| 7 |
"&|" |
| 8 |
"2>|" |
| 9 |
"&" |
| 10 |
".." |
| 11 |
"!" |
| 12 |
(direction) |
| 13 |
(stream_redirect) |
| 14 |
] @operator |
| 15 |
|
| 16 |
[ |
| 17 |
"not" |
| 18 |
"and" |
| 19 |
"or" |
| 20 |
] @keyword.operator |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
(if_statement |
| 25 |
[ |
| 26 |
"if" |
| 27 |
"end" |
| 28 |
] @keyword.control.conditional) |
| 29 |
|
| 30 |
(switch_statement |
| 31 |
[ |
| 32 |
"switch" |
| 33 |
"end" |
| 34 |
] @keyword.control.conditional) |
| 35 |
|
| 36 |
(case_clause |
| 37 |
[ |
| 38 |
"case" |
| 39 |
] @keyword.control.conditional) |
| 40 |
|
| 41 |
(else_clause |
| 42 |
[ |
| 43 |
"else" |
| 44 |
] @keyword.control.conditional) |
| 45 |
|
| 46 |
(else_if_clause |
| 47 |
[ |
| 48 |
"else" |
| 49 |
"if" |
| 50 |
] @keyword.control.conditional) |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
(while_statement |
| 55 |
[ |
| 56 |
"while" |
| 57 |
"end" |
| 58 |
] @keyword.control.repeat) |
| 59 |
|
| 60 |
(for_statement |
| 61 |
[ |
| 62 |
"for" |
| 63 |
"end" |
| 64 |
] @keyword.control.repeat) |
| 65 |
|
| 66 |
(begin_statement |
| 67 |
[ |
| 68 |
"begin" |
| 69 |
"end" |
| 70 |
] @keyword.control.repeat) |
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
[ |
| 75 |
"in" |
| 76 |
(break) |
| 77 |
(continue) |
| 78 |
] @keyword |
| 79 |
|
| 80 |
"return" @keyword.control.return |
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
[ |
| 85 |
"[" |
| 86 |
"]" |
| 87 |
"{" |
| 88 |
"}" |
| 89 |
"(" |
| 90 |
")" |
| 91 |
] @punctuation.bracket |
| 92 |
|
| 93 |
"," @punctuation.delimiter |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
(command name: (word) @function) |
| 98 |
|
| 99 |
(command |
| 100 |
name: (word) @function.builtin (#match? @function.builtin "^test$") |
| 101 |
argument: (word) @operator (#match? @operator "^(!?=|-[a-zA-Z]+)$")) |
| 102 |
|
| 103 |
(command |
| 104 |
name: (word) @punctuation.bracket (#match? @punctuation.bracket "^\\[$") |
| 105 |
argument: (word) @operator (#match? @operator "^(!?=|-[a-zA-Z]+)$")) |
| 106 |
|
| 107 |
(command |
| 108 |
argument: [ |
| 109 |
(word) @variable.parameter (#match? @variable.parameter "^-") |
| 110 |
] |
| 111 |
) |
| 112 |
|
| 113 |
|
| 114 |
(command |
| 115 |
name: [ |
| 116 |
(word) @function.builtin |
| 117 |
(#any-of? @function.builtin "abbr" "alias" "and" "argparse" "begin" "bg" "bind" "block" "break" "breakpoint" "builtin" "case" "cd" "command" "commandline" "complete" "contains" "continue" "count" "disown" "echo" "else" "emit" "end" "eval" "exec" "exit" "false" "fg" "for" "function" "functions" "history" "if" "isatty" "jobs" "math" "not" "or" "path" "printf" "pwd" "random" "read" "realpath" "return" "set" "set_color" "source" "status" "string" "switch" "test" "time" "true" "type" "ulimit" "wait" "while") |
| 118 |
] |
| 119 |
) |
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
(function_definition ["function" "end"] @keyword.function) |
| 124 |
|
| 125 |
(function_definition |
| 126 |
name: [ |
| 127 |
(word) (concatenation) |
| 128 |
] |
| 129 |
@function) |
| 130 |
|
| 131 |
(function_definition |
| 132 |
option: [ |
| 133 |
(word) |
| 134 |
(concatenation (word)) |
| 135 |
] @variable.parameter (#match? @variable.parameter "^-") |
| 136 |
) |
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
[(double_quote_string) (single_quote_string)] @string |
| 141 |
(escape_sequence) @constant.character.escape |
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
(variable_name) @variable |
| 146 |
(variable_expansion) @constant |
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
(integer) @constant.numeric.integer |
| 151 |
(float) @constant.numeric.float |
| 152 |
(comment) @comment |
| 153 |
|
| 154 |
((word) @constant.builtin.boolean |
| 155 |
(#match? @constant.builtin.boolean "^(true|false)$")) |