blob: 7d83af032520455b0ec6a9f7d475c6656e8aa878 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
(simple_expansion) @none
(expansion
"${" @punctuation.special
"}" @punctuation.special) @none
[
"("
")"
"{"
"}"
"["
"]"
] @punctuation.bracket
[
";"
";;"
(heredoc_start)
] @punctuation.delimiter
[
"$"
] @punctuation.special
[
">"
"<"
"&"
"&&"
"|"
"||"
"="
"=~"
"=="
"!="
] @operator
[
(string)
(raw_string)
(heredoc_body)
] @string
(variable_assignment (word) @string)
[
"if"
"then"
"else"
"elif"
"fi"
"case"
"in"
"esac"
] @conditional
[
"for"
"do"
"done"
"while"
] @repeat
[
"declare"
"export"
"local"
"readonly"
"unset"
] @keyword
(special_variable_name) @constant
((word) @constant.builtin
(#match? @constant.builtin "^SIG(INT|TERM|QUIT|TIN|TOU|STP|HUP)$"))
((word) @boolean
(#match? @boolean "^(true|false)$"))
(comment) @comment
(test_operator) @string
(command_substitution
[ "$(" ")" ] @punctuation.bracket)
(function_definition
name: (word) @function)
(command_name (word) @function)
((command_name (word) @function.builtin)
(#match? @function.builtin "^(cd|echo|eval|exit|getopts|pushd|popd|return|set|shift)$"))
(command
argument: [
(word) @parameter
(concatenation (word) @parameter)
])
((word) @number
(#match? @number "^[0-9]+$"))
(file_redirect
descriptor: (file_descriptor) @operator
destination: (word) @parameter)
(expansion
[ "${" "}" ] @punctuation.bracket)
(variable_name) @variable
((variable_name) @constant
(#match? @constant "^[A-Z][A-Z_0-9]*$"))
(case_item
value: (word) @parameter)
(regex) @string.regex
|