-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathAsterisk config.JSON-tmLanguage
115 lines (113 loc) · 3.18 KB
/
Asterisk config.JSON-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
// [PackageDev] target_format: plist, ext: tmLanguage
{
"name": "Asterisk config",
"scopeName": "source.asterisk.config",
"fileTypes": ["conf"],
"uuid": "01514276-8d8f-49e6-a8f3-08642d7f8b33",
"foldingStartMarker": "\\[.*\\])(\\((!)?.*?\\))?",
"foldingStopMarker": "?=\\[",
"repository": {
"path_value": {
"name": "constant.other",
"match": "(/[\\w-]+)+(\\.[\\w-]+)?"
},
"net_address_value": {
"name": "constant.other",
"match": "(\\w+://)?((\\w+:)?\\w+@)?([\\w-]+\\.)+[a-zA-Z-]+(:\\d+)?"
},
"ip_netmask_value": {
"name": "constant.other",
"match": "\\b((?:\\d{1,3}\\.){3}\\d{1,3})(?:/((?:\\d{1,3}\\.){3}\\d{1,3}))?\\b"
},
"boolean_value": {
"name": "constant.numeric",
"match": "\\b(true|false|yes|no|all)\\b"
},
"comment": {
"name": "comment.line",
"match": "(;).*$\\n?",
"1": { "name": "punctuation.definition.comment" }
}
},
"patterns": [
{ "include": "#comment" },
{
"name": "meta.section",
"begin": "(\\[(macro-)?.*\\])(?:\\((!)?\\s*,?(?:\\s*(\\w+)\\s*,?)*\\))?",
"beginCaptures": {
"1": { "name": "storage.type" },
"2": { "name": "storage.modifier" },
"3": { "name": "storage.modifier" },
"4": { "name": "entity.other-inherited-class" }
},
"end": "(?=\\[)",
"patterns": [
{ "include": "#comment" },
{
"name": "meta.extension",
"begin": "^\\s*(exten)\\s*(=>)\\s*(a|h|i|o|s|t|T|e|failed|fax|talk|receiver|(?:_[0-9XZN!\\.]+)),(\\d+|n)(\\(.*?\\))?,",
"beginCaptures": {
"1": { "name": "keyword.control" },
"2": { "name": "keyword.operator" },
"3": { "name": "support.constant" },
"4": { "name": "support.constant" },
"5": { "name": "support.class" }
},
"patterns": [
{
"name": "meta.internal.function",
"begin": "(NoOp|Answer|Dial|Hangup|Busy|MixMonitor|GotoIf|Goto|Set|Macro|Queue|Playback|Background|WaitExten|MusicOnHold|Ringing)\\(?",
"beginCaptures": {
"1": { "name": "support.function" }
},
"end": "\\)?\\s*$",
"patterns": [
{
"name": "support.variable",
"match": "\\$\\{.*\\}"
},
{
"name": "support.other",
"match": "\\?\\w+:\\w+"
}
]
}
],
"end": "$"
},
{
"name": "meta.expression",
"begin": "^\\s*([a-zA-Z_-]+)\\s*(=)(?!>)",
"beginCaptures": {
"1": { "name": "variable.parameter" },
"2": { "name": "keyword.operator" }
},
"end": "$",
"patterns": [
{ "include": "#path_value" },
{ "include": "#ip_netmask_value" },
{ "include": "#net_address_value" },
{ "include": "#boolean_value" },
{ "include": "#comment" }
]
},
{
"name": "meta.command",
"begin": "^\\s*(include|[a-zA-Z_-]+)\\s*(=>)",
"beginCaptures": {
"1": { "name": "keyword.control" },
"2": { "name": "keyword.operator" }
},
"end": "$",
"patterns": [
{ "include": "#path_value" },
{ "include": "#ip_netmask_value" },
{ "include": "#net_address_value" },
{ "include": "#boolean_value" },
{ "include": "#comment" }
]
}
]
}
]
}