Skip to content

Commit 710e646

Browse files
committed
Attempted fix
1 parent 64e9e05 commit 710e646

21 files changed

+1192
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
key: 'case-clause'
2+
patterns: [
3+
{
4+
'begin': '(?=\\S)'
5+
'end': ';;'
6+
'endCaptures':
7+
'0':
8+
'name': 'punctuation.terminator.case-clause.shell'
9+
'name': 'meta.scope.case-clause.shell'
10+
'patterns': [
11+
{
12+
'begin': '(\\(|(?=\\S))'
13+
'captures':
14+
'0':
15+
'name': 'punctuation.definition.case-pattern.shell'
16+
'end': '\\)'
17+
'name': 'meta.scope.case-pattern.shell'
18+
'patterns': [
19+
{
20+
'match': '\\|'
21+
'name': 'punctuation.separator.pipe-sign.shell'
22+
}
23+
{
24+
'include': '#string'
25+
}
26+
{
27+
'include': '#variable'
28+
}
29+
{
30+
'include': '#interpolation'
31+
}
32+
{
33+
'include': '#pathname'
34+
}
35+
]
36+
}
37+
{
38+
'begin': '(?<=\\))'
39+
'end': '(?=;;)'
40+
'name': 'meta.scope.case-clause-body.shell'
41+
'patterns': [
42+
{
43+
'include': '$self'
44+
}
45+
]
46+
}
47+
]
48+
}
49+
]

grammars/repositories/comment.cson

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
key: 'comment'
2+
patterns: [
3+
'begin': '(^\\s+)?(?<!\\S)(?=#)(?!#\\{)'
4+
'beginCaptures':
5+
'1':
6+
'name': 'punctuation.whitespace.comment.leading.shell'
7+
'end': '(?!\\G)'
8+
'patterns': [
9+
{
10+
'begin': '#!'
11+
'beginCaptures':
12+
'0':
13+
'name': 'punctuation.definition.comment.shebang.shell'
14+
'end': '\\n'
15+
'name': 'comment.line.number-sign.shebang.shell'
16+
}
17+
{
18+
'begin': '#'
19+
'beginCaptures':
20+
'0':
21+
'name': 'punctuation.definition.comment.shell'
22+
'end': '\\n'
23+
'name': 'comment.line.number-sign.shell'
24+
}
25+
]
26+
]
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
key: 'compound-command'
2+
patterns: [
3+
{
4+
'begin': '(\\[{1,2})'
5+
'captures':
6+
'1':
7+
'name': 'punctuation.definition.logical-expression.shell'
8+
'end': '(\\]{1,2})'
9+
'name': 'meta.scope.logical-expression.shell'
10+
'patterns': [
11+
{
12+
'include': '#logical-expression'
13+
}
14+
{
15+
'include': '$self'
16+
}
17+
]
18+
}
19+
{
20+
'begin': '(\\({2})'
21+
'beginCaptures':
22+
'0':
23+
'name': 'punctuation.definition.string.begin.shell'
24+
'end': '(\\){2})'
25+
'endCaptures':
26+
'0':
27+
'name': 'punctuation.definition.string.end.shell'
28+
'name': 'string.other.math.shell'
29+
'patterns': [
30+
{
31+
'include': '#math'
32+
}
33+
]
34+
}
35+
{
36+
'begin': '(\\()'
37+
'captures':
38+
'1':
39+
'name': 'punctuation.definition.subshell.shell'
40+
'end': '(\\))'
41+
'name': 'meta.scope.subshell.shell'
42+
'patterns': [
43+
{
44+
'include': '$self'
45+
}
46+
]
47+
}
48+
{
49+
'begin': '(?<=\\s|^)(\\{)(?=\\s|$)'
50+
'captures':
51+
'1':
52+
'name': 'punctuation.definition.group.shell'
53+
'end': '(?<=^|;)\\s*(\\})'
54+
'name': 'meta.scope.group.shell'
55+
'patterns': [
56+
{
57+
'include': '$self'
58+
}
59+
]
60+
}
61+
]
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
key: 'function-definition'
2+
patterns: [
3+
{
4+
'begin': '\\b(function)\\s+([^\\s\\\\]+)(?:\\s*(\\(\\)))?'
5+
'beginCaptures':
6+
'1':
7+
'name': 'storage.type.function.shell'
8+
'2':
9+
'name': 'entity.name.function.shell'
10+
'3':
11+
'name': 'punctuation.definition.arguments.shell'
12+
'end': ';|&|$'
13+
'endCaptures':
14+
'0':
15+
'name': 'punctuation.definition.function.shell'
16+
'name': 'meta.function.shell'
17+
'patterns': [
18+
{
19+
'include': '$self'
20+
}
21+
]
22+
}
23+
{
24+
'begin': '\\b([^\\s\\\\=]+)\\s*(\\(\\))'
25+
'beginCaptures':
26+
'1':
27+
'name': 'entity.name.function.shell'
28+
'2':
29+
'name': 'punctuation.definition.arguments.shell'
30+
'end': ';|&|$'
31+
'endCaptures':
32+
'0':
33+
'name': 'punctuation.definition.function.shell'
34+
'name': 'meta.function.shell'
35+
'patterns': [
36+
{
37+
'include': '$self'
38+
}
39+
]
40+
}
41+
]

0 commit comments

Comments
 (0)