-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathCForm.YAML-tmLanguage
163 lines (154 loc) · 6 KB
/
CForm.YAML-tmLanguage
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# [PackageDev] target_format: plist, ext: tmLanguage
---
name: CloudFormation
scopeName: source.cloudformation
fileTypes: [cform,template,cloudformation]
uuid: c16c4a59-fabd-4f51-a0a0-d8b306124516
patterns:
- include: '#value'
repository:
array:
name: meta.structure.array.json
begin: \[
beginCaptures:
'0': {name: punctuation.definition.array.begin.json}
end: \]
endCaptures:
'0': {name: punctuation.definition.array.end.json}
patterns:
- include: '#value'
- name: punctuation.separator.array.json
match: ','
- name: invalid.illegal.expected-array-separator.json
match: '[^\s\]]'
comments:
patterns:
- name: comment.block.documentation.json
begin: /\*\*
end: \*/
captures:
'0': {name: punctuation.definition.comment.json}
- name: comment.block.json
begin: /\*
end: \*/
captures:
'0': {name: punctuation.definition.comment.json}
- name: comment.line.double-slash.js
match: (//).*$\n?
captures:
'1': {name: punctuation.definition.comment.json}
constant:
name: constant.language.json
match: \b(?:true|false|null)\b
number:
comment: handles integer and decimal numbers
name: constant.numeric.json
match: "(?x: # turn on extended mode\n\t\t\t -? #\
\ an optional minus\n\t\t\t (?:\n\t\t\t 0 #\
\ a zero\n\t\t\t | # ...or...\n\t\t\t [1-9]\
\ # a 1-9 character\n\t\t\t \\d* # followed by zero or\
\ more digits\n\t\t\t )\n\t\t\t (?:\n\t\t\t \
\ (?:\n\t\t\t \\. # a period\n\t\t\t \
\ \\d+ # followed by one or more digits\n\t\t\t )?\n\t\t\
\t (?:\n\t\t\t [eE] # an e character\n\t\t\t\
\ [+-]? # followed by an option +/-\n\t\t\t \
\ \\d+ # followed by one or more digits\n\t\t\t )? #\
\ make exponent optional\n\t\t\t )? # make decimal portion\
\ optional\n\t\t\t )"
object:
comment: a JSON object
name: meta.structure.dictionary.json
begin: \{
beginCaptures:
'0': {name: punctuation.definition.dictionary.begin.json}
end: \}
endCaptures:
'0': {name: punctuation.definition.dictionary.end.json}
patterns:
- comment: the JSON object key
include: '#string'
- include: '#comments'
- name: meta.structure.dictionary.value.json
begin: ':'
beginCaptures:
'0': {name: punctuation.separator.dictionary.key-value.json}
end: (,)|(?=\})
endCaptures:
'1': {name: punctuation.separator.dictionary.pair.json}
patterns:
- comment: the JSON object value
include: '#value'
- name: invalid.illegal.expected-dictionary-separator.json
match: '[^\s,]'
- name: invalid.illegal.expected-dictionary-separator.json
match: '[^\s\}]'
string:
name: string.quoted.double.json
begin: '"'
beginCaptures:
'0': {name: punctuation.definition.string.begin.json}
end: '"'
endCaptures:
'0': {name: punctuation.definition.string.end.json}
patterns:
- include: '#aws'
- name: constant.character.escape.json
match: |-
(?x: # turn on extended mode
\\ # a literal backslash
(?: # ...followed by...
["\\/bfnrt] # one of these characters
| # ...or...
u # a u
[0-9a-fA-F]{4} # and four hex digits
)
)
- name: invalid.illegal.unrecognized-string-escape.json
match: \\.
aws:
comment: "AWS-specific objects"
patterns:
- name: constant.language.cloudformation
match: \w*::\w*
- name: constant.other.cloudformation
match: \b(Ref)\b
- name: keyword.control.cloudformation
match: us-east-[\d]\w*|us-west-[\d]\w*|eu-west-[\d]\w*|eu-central-[\d]\w*|ap-southeast-[\d]\w*|ap-northeast-[\d]\w*|sa-east-[\d]\w*
- name: keyword.other.cloudformation
match: m[1-4]\.\w*|m[1-4]\.\w*|t[1-3]\.\w*|c[1-4]\.\w*|r[1-3]\.\w*|g[1-3]\.\w*|i[1-3]\.\w*|hs[1-3]\.\w*|cr[1-3]\.\w*|cg[1-3]\.\w*|hi[1-3]\.\w*|cc[1-3]\.\w*
- name: variable.parameter
match: String|Number|CommaDelimitedList|ami-\w*|True|False|tcp|udp
value:
comment: "the 'value' diagram at http://json.org"
patterns:
- include: '#constant'
- include: '#number'
- include: '#string'
- include: '#array'
- include: '#object'
- include: '#comments'
- include: '#aws'
foldingStartMarker: |-
(?x: # turn on extended mode
^ # a line beginning with
\s* # some optional space
[{\[] # the start of an object or array
(?! # but not followed by
.* # whatever
[}\]] # and the close of an object or array
,? # an optional comma
\s* # some optional space
$ # at the end of the line
)
| # ...or...
[{\[] # the start of an object or array
\s* # some optional space
$ # at the end of the line
)
foldingStopMarker: |-
(?x: # turn on extended mode
^ # a line beginning with
\s* # some optional space
[}\]] # and the close of an object or array
)
keyEquivalent: ^~J