-
Notifications
You must be signed in to change notification settings - Fork 3
/
dotenv.mtsx
64 lines (57 loc) · 1.73 KB
/
dotenv.mtsx
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
// require MT >= 2.16.0
// ################# LICENCE START ################
// Copyright (c) 2024 shiguobaona
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ################# LICENCE END ##################
{
name: ["DotEnv", ".env"]
comment: {startsWith: "#", addToContains: false}
styles: [
"comment" #8C8C8C, #808080, //@I
// 取消上行注释将注释变为斜体
"escape" #A371F7, #866BD3, @B
"equal" #CC7832, #CC7832, //@B
"key" #4663CC, #D7BA7D
"value" #0077FF, #5DB0EE
"str" #639274, #7FADB6
"line_break" #871094, #C2C342, @B
"line_break2" #CC9ABB, #FBBAAA
]
defines: [
"comment": {match: /(?:#.*)/, 0: "comment"}
"escape": {match: /(?:(?:\\[#\\=])|(\\n))/, 0: "escape" 1: "line_break2"}
"rowVar": {
match: /(?m)^([^ ]+?) *?(=) *?(.*)/,
1: "key"
2: "equal"
3: "value"
3: {match: /(?:'.*?')|(?:".*?")/, 0: "str"}
0: {include: "contains"}
}
"lineBreak1": {match: /(?m)\\ *$/, 0: "line_break"}
"lineBreak": {
match: /(?m)(?:(?<=\\ ?$\n).*)*/,
0: "value"
0: {include: "contains"}
}
"contains": [
{include: "comment"}
{include: "escape"}
{include: "lineBreak1"}
]
]
contains: [
{include: "comment"}
{include: "rowVar"}
{include: "escape"}
{include: "lineBreak"}
]
}