forked from axelav/highlight-syntax-es6
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsh.json
65 lines (65 loc) · 2.27 KB
/
sh.json
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
{
"name": "sh",
"match": "^(ba)?sh$",
"kw0":["alias","bg","bind","break","builtin","caller","cd","command",
"compgen","complete","compopt","continue","declare","typeset","dirs",
"disown","echo","enable","eval","exec","exit","export","fc","fg","getopts",
"hash","help","history","jobs","kill","let","local","logout","mapfile",
"readarray","popd","printf","pushd","pwd","read","readonly","return","set",
"shift","shopt","source","suspend","test","[","]","times","trap","type",
"ulimit","umask","unalias","unset","wait","."],
"kw1":["ls","sed","grep"],
"rules": [
["shebang","^(#![^\\n]*)$"],
["line comment","^#[^\\n]*$"],
["whitespace","^(\\s+)$"],
["set var","^(export\\s+)?(\\w+=)(.*)$",[
[
["identifier","^\\w+$"],
["whitespace","^\\s+$"]
],
[["variable","^.+$"]],
[
["argument","^([^'\"\\s<>|\\\\$]+)$"],
["variable","^(\\$[\\w*@#?$!-]*)$"],
["single quote","^'[^']*'?$"],
["double quote","^\"([^\"]|\\\\\")*\"?$"]
]
]],
["open paren","^\\($"],
["close paren","^\\)$"],
["command","^([^\\s'\"|&;()]+)((?:[^\\n'\"|&;]|\\\\[\\n'\"|&;]|'[^']*(?:'|$)|\"(?:[^\"]|\\\\\")*(?:\"|$)|<<(\\S*)(?:.|\\n(?!\\3))*(?:\\n\\1?)?)*)$", [
[
["identifier","^.+$"]
],
[
["argument","^([^'\"\\s<>|$]+|\\\\\\$)*$"],
["variable","^(\\$[\\w*@#?$!-]*)$"],
["command-substitution","^\\$\\{[^}]*\\}?$"],
["single quote","^'[^']*'?$"],
["double quote","^(\"(?:[^\"]|\\\\\")*\"?)$",[[
["variable","^(\\$[\\w*@#?$!-]*)$"],
["command-substitution","^\\$\\{[^}]*\\}?$"],
["text","^([^$]|\\\\\\$?)+$"]
]]],
["heredoc","^(<<)(\\S*)((?:.|\\n(?!\\2))*)(\\n\\2)?$",[
[["operator","^.+$"]],
[["operator","^.+$"]],
[
["variable","^(\\$[\\w*@#?$!-]*)$"],
["command-substitution","^\\$\\{[^}]*\\}?$"],
["text","^([^$]|\\\\\\$?)+$"]
],
[
["whitespace","^\\s+$"],
["operator","^\\S+$"]
]
]],
["operator","^([<|&;!\\[\\]]|>>?|\\|\\||&&)$"],
["whitespace","^(\\s+)$"],
["line continue","^\\\\\\n?$"]
]
] ],
["operator","^([|&;]|\\|\\||&&)$"]
]
}