forked from abulimov/atom-language-haproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhaproxy.cson.template
More file actions
122 lines (122 loc) · 4.08 KB
/
haproxy.cson.template
File metadata and controls
122 lines (122 loc) · 4.08 KB
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
# ------------------------------------------
# This file is auto-generated by generate.py
# https://github.com/abulimov/atom-language-haproxy
# ------------------------------------------
fileTypes: [
"haproxy"
"cfg"
]
foldingStartMarker: "^(backend|defaults|frontend|global|listen|mailers|peers|ruleset|userlist)"
foldingStopMarker: "^(backend|defaults|frontend|global|listen|mailers|peers|ruleset|userlist)"
name: "HAProxy"
patterns: [
{
captures:
"2":
name: "string.unquoted.sectionname.haproxy-config"
"3":
name: "variable.parameter.ip-port.haproxy-config"
"5":
name: "punctuation.separator.ip.haproxy-config"
"6":
name: "variable.parameter.ip-port.haproxy-config"
match: "^(backend|defaults|frontend|global|listen|mailers|peers|ruleset|userlist)\\s*(\\S+)?\\s*((\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})?:\\d{1,5})?(,)?((\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})?:\\d{1,5})?"
name: "meta.tag.haproxy-config"
}
# Comment
{
match: "#.+$"
name: "comment.line.number-sign.haproxy-config"
}
# IP address:port
{
match: "(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})?:\\d{1,5}"
name: "variable.parameter.ip-port.haproxy-config"
}
# Numbers
{
# this also inludes ip address-like dot separated instant with optional port
# also optional letter supported, like '100s'
match: "\\b[0-9]+([\\.:][0-9]+)*[a-z]?\\b"
name: "constant.numeric.haproxy-config"
}
# Keywords
{
match: "{keywords}"
name: "keyword.other.no-validate-params.haproxy-config"
}
# Global keywords
{
match: "{global_keywords}"
name: "keyword.other.no-validate-params.haproxy-config"
}
# Mailers
{
match: "{mailers_options}"
name: "keyword.other.no-validate-params.haproxy-config"
}
# Peers
{
match: "{peers_options}"
name: "keyword.other.no-validate-params.haproxy-config"
}
# Keywords made up of two words - first word
{
match: "{double_first}"
name: "keyword.other.no-validate-params.haproxy-config"
}
# Keywords made up of two words - second word
{
match: "{double_second}"
name: "variable.language.reserved.haproxy-config"
}
# Bind options
{
match: "{bind_options}"
name: "variable.language.reserved.haproxy-config"
}
# Server options
{
match: "{server_options}"
name: "variable.language.reserved.haproxy-config"
}
# Stick-table options
{
match: "\\s+(type|size|expire|nopurge|peers|store)(?=\\s+)"
name: "variable.language.reserved.haproxy-config"
}
# http-request / http-response options
{
match: "\\s+(allow|auth|redirect|reject|tarpit|deny|deny_status|add-header|set-challenge|set-header|set-src|set-status|capture|len|id|del-header|set-nice|set-log-level|replace-header|replace-value|set-method|set-uri|add-acl|del-acl|del-map|set-map|set-var|unset-var|track-sc0|track-sc1|track-sc2|sc-inc-gpc0|sc-inc-gpc1|sc-set-gpt0|silent-drop|send-spoe-group|cache-store|cache-use)(?=\\s+)"
name: "variable.language.reserved.haproxy-config"
}
# Keyword options
{
match: "\\s+(roundrobin|static-rr|leastconn|first|url_param|health|global|httplog|except|kern|user|mail|daemon|auth|syslog|lpr|news|uucp|cron|auth2|ftp|ntp|audit|alert|cron2|local0|local1|local2|local3|local4|local5|local6|local7|emerg|crit|err|warning|notice|info|debug|rewrite|insert|nocache|postonly|indirect|prefix|location|scheme|code|request|response|header|check|cookie|weight|usesrc|http|tcp)(?=\\s+)"
name: "variable.language.reserved.extra.haproxy-config"
}
{
match: "\\\\"
name: "constant.character.escape.haproxy-config"
}
# Fetches
{
match: "\\s+((base|cook|hdr|path|shdr|url|urlp)(_beg|_dir|_dom|_end|_len|_reg|_sub)?)\\b"
name: "entity.name.function.hdr.haproxy-config"
}
# ACL conditionals
{
match: "\\b(if|rewrite)\\b"
name: "keyword.control.directive.module.http.rewrite"
}
{
match: "%\\[[^\\]]+\\]"
name: "variable.language.other.haproxy-config"
}
# Logical operators
{
match: "\\s+(or|\\|\\||!)\\s+"
name: "keyword.operator.logical.haproxy-config"
}
]
scopeName: "source.haproxy-config"