-
Notifications
You must be signed in to change notification settings - Fork 2
/
caddyfile.tmLanguage.json
104 lines (104 loc) · 2.39 KB
/
caddyfile.tmLanguage.json
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
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "Caddyfile",
"fileTypes": [ "Caddyfile", "Wedgefile" ],
"patterns": [
{ "include": "#comments" },
{ "include": "#variables" },
{ "include": "#strings" },
{
"begin": "(^.*)({\\s+$)",
"end": "^\\s*}$",
"beginCaptures": {
"0": { "name": "support.function.Caddyfile" }
},
"endCaptures": {
"0": { "name": "support.function.Caddyfile" }
},
"patterns": [
{ "include": "#comments" },
{ "include": "#variables" },
{ "include": "#strings" },
{
"comment": "Directives",
"captures": {
"2": { "name": "support.constant.Caddyfile" },
"4": { "name": "string.Caddyfile" },
"5": { "name": "support.constant.Caddyfile" }
},
"match": "^\\s*((on)( \\b\\w+\\b )(.*$))?([\\w-]*)"
},
{
"begin": "\\s+{$",
"end": "^\\s*}$",
"patterns": [
{ "include": "#comments" },
{ "include": "#variables" },
{ "include": "#strings" },
{
"comment": "Sub Directives",
"captures": {
"2": { "name": "keyword.Caddyfile" }
},
"match": "(^\\s*)([\\w-]+\\b)"
}
]
}
]
},
{
"comment": "import: the only directive allowed outside a block",
"match": "^\\s*import",
"name": "support.type.Caddyfile"
},
{
"comment": "lines that end in a comma are still part of the main directive, there may be a better way of doing this but I couol",
"match": "(^.*)(,\\s+$)",
"name": "support.class.Caddyfile"
}
],
"repository": {
"variables": {
"patterns": [
{
"name": "support.other.variable.Caddyfile",
"match": "{[$\\w]+}"
}
]
},
"comments": {
"patterns": [
{
"name": "comment.line.Caddyfile",
"match": "#.*"
}
]
},
"strings": {
"patterns": [
{
"comment": "Double Quoted Strings",
"begin": "\"",
"end": "\"",
"name": "string.quoted.double.Caddyfile",
"patterns": [
{ "include": "#variables" }
]
},
{
"comment": "Single Quoted Strings",
"begin": "'",
"end": "'",
"name": "string.quoted.single.Caddyfile"
}
]
},
"domains": {
"patterns": [{
"name": "keyword.control.caddyfile",
"match": "(((\\d{1,3}\\.){3}\\d{1,3})|(((\\d|\\w){1,}\\.)?(\\w|\\d){1,63})(\\.\\w{2,24}))(:\\d{1,})?\\s"
}]
}
},
"scopeName": "source.Caddyfile"
}