@@ -0,0 +1,116 @@
1+%YAML 1.2
2+---
3+# See http://www.sublimetext.com/docs/3/syntax.html
4+file_extensions:
5+ - log
6+scope: text.log
7+variables:
8+ ipv4_part: (?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)
9+contexts:
10+ main:
11+ - match: (\w+)(=)
12+ captures:
13+ 1: variable.parameter.log
14+ 2: keyword.operator.assignment.log
15+ - match: (')([^']*)(')
16+ scope: string.quoted.single.log
17+ captures:
18+ 1: punctuation.definition.string.begin.log
19+ 3: punctuation.definition.string.end.log
20+ - match: (")([^"]*)(")
21+ scope: string.quoted.double.log
22+ captures:
23+ 1: punctuation.definition.string.begin.log
24+ 3: punctuation.definition.string.end.log
25+ - include: dates
26+ - include: ip_addresses
27+ - include: numbers
28+ - match: \b(?i:fail(?:ure|ed)?|error|exception)\b
29+ scope: markup.error.log
30+ - match: \b(?i:warn(?:ing)?)\b
31+ scope: markup.warning.log
32+ #- include: scope:text.html.markdown#autolink-inet
33+ - match: \b\w+:/{2,3}
34+ scope: markup.underline.link.scheme.log
35+ push: url-host
36+ dates:
37+ - match: \b\d{4}-\d{2}-\d{2}\b
38+ scope: meta.date.log meta.number.integer.decimal.log constant.numeric.value.log
39+ - match: \b\d{4}/\d{2}/\d{2}\b
40+ scope: meta.date.log meta.number.integer.decimal.log constant.numeric.value.log
41+ - match: \b(?:[01]\d|2[0-3]):(?:[0-5]\d):(?:[0-5]\d)(?:(\.)\d{3})?\b
42+ scope: meta.time.log meta.number.integer.decimal.log constant.numeric.value.log
43+ captures:
44+ 1: punctuation.separator.decimal.log
45+ ip_addresses:
46+ - match: \b(?=(?:{{ipv4_part}}\.){3}{{ipv4_part}}\b)
47+ push:
48+ - meta_scope: meta.ipaddress.v4.log meta.number.integer.decimal.log
49+ - match: \d+
50+ scope: constant.numeric.value.log
51+ - match: \.
52+ scope: punctuation.separator.sequence.log
53+ - match: ''
54+ pop: true
55+ - match: (?=(?:\h{0,4}:){2,6}\h{1,4}\b)
56+ push:
57+ - meta_scope: meta.ipaddress.v6.log meta.number.integer.hexadecimal.log
58+ - match: \h{1,4}
59+ scope: constant.numeric.value.log
60+ - match: ':'
61+ scope: punctuation.separator.sequence.log
62+ - match: ''
63+ pop: true
64+ numbers:
65+ - match: \b(0x)(\h+)(?:(\.)(\h+))?\b
66+ scope: meta.number.float.hexadecimal.log
67+ captures:
68+ 1: constant.numeric.base.log
69+ 2: constant.numeric.value.log
70+ 3: constant.numeric.value.log punctuation.separator.decimal.log
71+ 4: constant.numeric.value.log
72+ - match: \b\d+(\.)\d+\b
73+ scope: meta.number.float.log constant.numeric.value.log
74+ captures:
75+ 1: punctuation.separator.decimal.log
76+ - match: \b\d+\b
77+ scope: meta.number.integer.log constant.numeric.value.log
78+ url-host:
79+ - meta_content_scope: markup.underline.link.host.log
80+ - match: \[
81+ scope: punctuation.section.brackets.begin.log
82+ push:
83+ - match: \]
84+ scope: punctuation.section.brackets.end.log
85+ pop: true
86+ - include: ip_addresses
87+ - match: '[^:/\s]+'
88+ - match: ''
89+ set: url-after-host
90+ url-after-host:
91+ - match: (:)(\d+)
92+ scope: markup.underline.link.port.log
93+ captures:
94+ 1: punctuation.separator.mapping.port.log
95+ 2: constant.numeric.value.log
96+ #- include: scope:text.html.markdown#url-escaped-chars
97+ - match: (%)\h{2}
98+ scope: markup.underline.link.path.log constant.character.escape.url.log
99+ captures:
100+ 1: punctuation.definition.escape.log
101+ # After a valid domain, zero or more non-space non-< characters may follow
102+ - match: (?=[?!.,:*_~]*[\s<]) # Trailing punctuation (specifically, ?, !, ., ,, :, *, _, and ~) will not be considered part of the autolink, though they may be included in the interior of the link
103+ pop: true
104+ - match: \( # When an autolink ends in ), we scan the entire autolink for the total number of parentheses. If there is a greater number of closing parentheses than opening ones, we don’t consider the last character part of the autolink, in order to facilitate including an autolink inside a parenthesis
105+ push:
106+ - meta_scope: markup.underline.link.path.log
107+ - match: (?=[?!.,:*_~]*[\s<])
108+ pop: true
109+ - match: \)
110+ pop: true
111+ - match: (?=\)[?!.,:*_~]*[\s<])
112+ pop: true
113+ - match: '[^?!.,:*_~\s<&()%]+|\S'
114+ scope: markup.underline.link.path.log
115+ - match: ''
116+ pop: true