forked from zaynali53/DotENV
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DotENV.YAML-tmLanguage
104 lines (92 loc) · 2.65 KB
/
DotENV.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
# [PackageDev] target_format: plist, ext: tmLanguage
---
name: DotENV
scopeName: source.env
fileTypes: [
".env",
".env.dist",
".env.local",
".env.sample",
".env.example",
".env.test",
".env.test.local",
".env.testing",
".env.dev",
".env.development",
".env.development.local",
".env.prod",
".env.production",
".env.production.local",
".env.dusk.local",
".env.staging",
".env.default",
".env.defaults",
".envrc",
".flaskenv",
]
uuid: 09d4e117-0975-453d-a74b-c2e525473f97
patterns:
- comment: 'Comments - starts with #'
match: '(#).*$\n?'
name: comment.line.number-sign.env
captures:
'1': { name: punctuation.definition.comment.env }
- comment: Strings (double)
name: string.quoted.double.env
begin: (\")
beginCaptures:
'1': { name: punctuation.definition.string.begin.env }
patterns:
- include: '#interpolation'
- include: '#variable'
- include: '#escape-characters'
end: (\")
endCaptures:
'1': { name: punctuation.definition.string.end }
- comment: Strings (single)
name: string.quoted.single.env
begin: (\')
beginCaptures:
'1': { name: punctuation.definition.string.begin.env }
end: (\')
endCaptures:
'1': { name: punctuation.definition.string.end }
- comment: Assignment Operator
match: (?<=[\w])\s?=
name: keyword.operator.assignment.env
- comment: Variable
match: '([\w]+)(?=\s?\=)'
name: variable.other.env
- comment: Keywords
match: '(?i)\s?(export)'
name: keyword.other.env
- comment: Constants
match: '(?i)(?<=\=)\s?(true|false|null)'
name: constant.language.env
- comment: Numeric
match: '\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b'
name: constant.numeric.env
repository:
interpolation:
comment: 'Template Syntax: "foo ${bar} {$baz}"'
begin: '(\$\{|\{)'
beginCaptures:
'1': { name: string.interpolated.env keyword.other.template.begin.env }
patterns:
- match: '(?x)(\$+)?([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*?\b)'
captures:
'1': { name: punctuation.definition.variable.env variable.other.env }
'2': { name: variable.other.env }
end: '(\})'
endCaptures:
'1': { name: string.interpolated.env keyword.other.template.end.env }
variable:
patterns:
- match: '(?x)(\$+)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*?\b)'
captures:
'1': { name: punctuation.definition.variable.env variable.other.env }
'2': { name: variable.other.env }
escape-characters:
patterns:
- match: \\[nrt\\\$\"\']
name: constant.character.escape.env