| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
(comment) @comment |
| 5 |
|
| 6 |
(if "if" @keyword.control.conditional) |
| 7 |
(if (elif "elif" @keyword.control.conditional)) |
| 8 |
(if (else "else" @keyword.control.conditional)) |
| 9 |
|
| 10 |
(while "while" @keyword.control.repeat) |
| 11 |
(while (else "else" @keyword.control.repeat)) |
| 12 |
(for "for" @keyword.control.repeat) |
| 13 |
(for (else "else" @keyword.control.repeat)) |
| 14 |
|
| 15 |
(try "try" @keyword.control.exception) |
| 16 |
(try (catch "catch" @keyword.control.exception)) |
| 17 |
(try (else "else" @keyword.control.exception)) |
| 18 |
(try (finally "finally" @keyword.control.exception)) |
| 19 |
|
| 20 |
(import "use" @keyword.control.import) |
| 21 |
(import (bareword) @string.special) |
| 22 |
|
| 23 |
(wildcard ["*" "**" "?"] @string.special) |
| 24 |
|
| 25 |
(command argument: (bareword) @variable.parameter) |
| 26 |
(command head: (identifier) @function) |
| 27 |
((command head: (identifier) @keyword.control.return) |
| 28 |
(#eq? @keyword.control.return "return")) |
| 29 |
((command (identifier) @keyword.operator) |
| 30 |
(#match? @keyword.operator "(and|or|coalesce)")) |
| 31 |
((command head: _ @function) |
| 32 |
(#match? @function "([+]|[-]|[*]|[/]|[%]|[<]|[<][=]|[=][=]|[!][=]|[>]|[>][=]|[<][s]|[<][=][s]|[=][=][s]|[!][=][s]|[>][s]|[>][=][s])")) |
| 33 |
|
| 34 |
(pipeline "|" @operator) |
| 35 |
(redirection [">" "<" ">>" "<>"] @operator) |
| 36 |
|
| 37 |
(io_port) @constant.numeric |
| 38 |
|
| 39 |
(function_definition |
| 40 |
"fn" @keyword.function |
| 41 |
(identifier) @function) |
| 42 |
|
| 43 |
(parameter_list) @variable.parameter |
| 44 |
(parameter_list "|" @punctuation.bracket) |
| 45 |
|
| 46 |
(variable_declaration |
| 47 |
"var" @keyword |
| 48 |
(lhs (identifier) @variable)) |
| 49 |
|
| 50 |
(variable_assignment |
| 51 |
"set" @keyword |
| 52 |
(lhs (identifier) @variable)) |
| 53 |
|
| 54 |
(temporary_assignment |
| 55 |
"tmp" @keyword |
| 56 |
(lhs (identifier) @variable)) |
| 57 |
|
| 58 |
(variable_deletion |
| 59 |
"del" @keyword |
| 60 |
(identifier) @variable) |
| 61 |
|
| 62 |
|
| 63 |
(number) @constant.numeric |
| 64 |
(string) @string |
| 65 |
|
| 66 |
(variable (identifier) @variable) |
| 67 |
((variable (identifier) @function) |
| 68 |
(#match? @function ".+\\~$")) |
| 69 |
((variable (identifier) @constant.builtin.boolean) |
| 70 |
(#match? @constant.builtin.boolean "(true|false)")) |
| 71 |
((variable (identifier) @constant.builtin) |
| 72 |
(#match? @constant.builtin "(_|after-chdir|args|before-chdir|buildinfo|nil|notify-bg-job-success|num-bg-jobs|ok|paths|pid|pwd|value-out-indicator|version)")) |
| 73 |
|
| 74 |
["$" "@"] @punctuation.special |
| 75 |
["(" ")" "[" "]" "{" "}"] @punctuation.bracket |
| 76 |
";" @punctuation.delimiter |