-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbash.yaml
More file actions
63 lines (51 loc) · 2.27 KB
/
bash.yaml
File metadata and controls
63 lines (51 loc) · 2.27 KB
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
filetype: bash
detect:
filename: "\\.(ba)?sh$"
header: "^#!.*/(env +)?bash( |$)"
rules:
# https://www.gnu.org/software/bash/manual/bash.html#Index-of-Shell-Builtin-Commands
- statement: ":(\\s|$)"
- statement: "\\.\\s"
- statement: "(\\[\\s|\\s\\])"
- statement: "\\b(alias|bg|bind|break|builtin|caller|cd|command|compgen|complete|compopt|continue|declare|dirs|disown|echo|enable|eval|exec|exit|export|fc|fg|getopts|hash|help|history|jobs|kill|let|local|logout|mapfile|popd|printf|pushd|pwd|read|readarray|readonly|return|set|shift|shopt|source|suspend|test|times|trap|type|typeset|ulimit|umask|unalias|unset|wait)\\b"
# https://www.gnu.org/software/bash/manual/bash.html#Index-of-Shell-Reserved-Words
- special: "(!\\s|\\[\\[\\s|\\s\\]\\]|\\{\\s|;\\s\\})"
- special: "\\b(case|do|done|elif|else|esac|fi|for|function|if|in|select|then|time|until|while)\\b"
- default: "--?[\\w-]+"
- default: "\\w+[=-]"
- default: "\\.\\w+"
# https://www.gnu.org/software/bash/manual/bash.html#index-control-operator
# https://www.gnu.org/software/bash/manual/bash.html#index-metacharacter
# https://www.gnu.org/software/bash/manual/bash.html#Command-Substitution
# https://www.gnu.org/software/bash/manual/bash.html#Process-Substitution
# https://www.gnu.org/software/bash/manual/bash.html#Arithmetic-Expansion
- special: "(\\||&|;|\\(|\\)|<|>|\\$)"
# https://www.gnu.org/software/bash/manual/bash.html#Brace-Expansion
- special: "[{,}]"
# https://www.gnu.org/software/bash/manual/bash.html#Tilde-Expansion
- special: "~"
# https://www.gnu.org/software/bash/manual/bash.html#Parameter-and-Variable-Index
- constant: "\\$[_!?@*#$0-]"
# https://www.gnu.org/software/bash/manual/bash.html#Shell-Parameter-Expansion
- constant: "\\$[A-Za-z_]\\w*"
- constant: "\\$\\{[^}]+\\}"
# https://www.gnu.org/software/bash/manual/bash.html#Quoting-1
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules: []
- constant.string:
start: "'"
end: "'"
rules: []
# https://www.gnu.org/software/bash/manual/bash.html#Comments
- comment:
start: "(^|\\s)#"
end: "$"
rules: []
# https://www.gnu.org/software/bash/manual/bash.html#Here-Documents
- default:
start: "<<(-)?EO."
end: "EO."
rules: []