-
Notifications
You must be signed in to change notification settings - Fork 1
/
HOCON.YAML-tmLanguage
136 lines (113 loc) · 3.19 KB
/
HOCON.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
# [PackageDev] target_format: plist, ext: tmLanguage
---
name: HOCON
scopeName: source.hocon
fileTypes: [conf]
uuid: 15e12a0a-a88e-47bd-a967-a8393605cd60
patterns:
- include: '#value'
repository:
number:
name: constant.numeric.hocon
match: (-?(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:[eE][+-]?\d+)?)?)
time-unit:
match: (\d+)\s*(nanoseconds?|microseconds?|milliseconds?|seconds?|minutes?|hours?|days?|ns|us|ms|s|m|h|d)
captures:
'1': {name: constant.numeric.time.hocon}
'2': {name: keyword.other.time.unit.hocon}
keyword:
patterns:
- match: '\+='
name: keyword.operator.hocon
- match: (?:^|\s)(true|false|yes|no|on|off|null)(?=$|\s)
captures:
'1': {name: keyword.other.boolean.hocon}
- begin: (?:^|\s)(include (?:url|file|classpath))\s*\(
end: '\)'
beginCaptures:
'1': {name: keyword.other.include.hocon}
patterns:
- include: '#string'
- match: (?:^|\s)(include)\s
captures:
'1': {name: keyword.other.include.hocon}
patterns:
- include: '#string'
hash-comment:
match: (#.*$\n?)
captures:
'0': {name: comment.line.number-sign.hocon}
slashes-comment:
match: (//.*$\n?)
captures:
'0': {name: punctuation.definition.comment.hocon}
multiline-string:
name: string.quoted.triple.hocon
begin: '"""'
end: '"""'
captures:
'0': {name: punctuation.definition.string.hocon}
patterns:
- name: constant.character.escape.hocon
match: (\\(?:["\\/bfnrt]|u[0-9a-fA-F]{4}))
- name: invalid.illegal.unrecognized-string-escape.hocon
match: \\.
string:
name: string.quoted.double.hocon
begin: '"'
end: '"'
captures:
'0': {name: punctuation.definition.string.hocon}
patterns:
- name: constant.character.escape.hocon
match: (\\(?:["\\/bfnrt]|u[0-9a-fA-F]{4}))
- name: invalid.illegal.unrecognized-string-escape.hocon
match: \\.
name:
name: entity.name.function.hocon
match: ([a-zA-Z_][a-zA-Z0-9_$\.-]*)
substitution:
name: variable.parameter.substitution.hocon
begin: (\$\{\??)
end: (\})
captures:
'0': {name: variable.parameter.substitution.hocon}
patterns:
- name: variable.parameter.substitution.hocon
match: ([a-zA-Z_][a-zA-Z0-9_$\.-]*)
list:
name: meta.structure.array.hocon
begin: '\['
end: '\]'
captures:
'0': {name: punctuation.definition.list.hocon}
patterns:
- include: '#value'
- name: punctuation.separator.array.hocon
match: ','
- name: invalid.illegal.expected-list-separator.hocon
match: ([^\s\]])
object:
begin: '\{'
end: '\}'
captures:
'0': {name: punctuation.definition.section.hocon}
patterns:
- include: '#name'
name: entity.name.function.hocon
- name: punctuation.separator.key-value.hocon
match: ((?:=|:)|\s*(?=\{))
- include: '#value'
value:
patterns:
- include: '#hash-comment'
- include: '#slashes-comment'
- include: '#time-unit'
- include: '#number'
- include: '#keyword'
- include: '#substitution'
- include: '#string'
- include: '#multiline-string'
- include: '#list'
- include: '#object'
...