@@ -0,0 +1,114 @@
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)\b
29+ scope: invalid.illegal.error.log
30+ #- include: scope:text.html.markdown#autolink-inet
31+ - match: \b\w+:/{2,3}
32+ scope: markup.underline.link.scheme.log
33+ push: url-host
34+ dates:
35+ - match: \b\d{4}-\d{2}-\d{2}\b
36+ scope: meta.date.log meta.number.integer.decimal.log constant.numeric.value.log
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(?:[01]\d|2[0-3]):(?:[0-5]\d):(?:[0-5]\d)(?:(\.)\d{3})?\b
40+ scope: meta.time.log meta.number.integer.decimal.log constant.numeric.value.log
41+ captures:
42+ 1: punctuation.separator.decimal.log
43+ ip_addresses:
44+ - match: (?=(?:{{ipv4_part}}\.){3}{{ipv4_part}})
45+ push:
46+ - meta_scope: meta.ipaddress.v4.log meta.number.integer.decimal.log
47+ - match: \d+
48+ scope: constant.numeric.value.log
49+ - match: \.
50+ scope: punctuation.separator.sequence.log
51+ - match: ''
52+ pop: true
53+ - match: (?=(?:\h{0,4}:){2,6}\h{1,4})
54+ push:
55+ - meta_scope: meta.ipaddress.v6.log meta.number.integer.hexadecimal.log
56+ - match: \h{1,4}
57+ scope: constant.numeric.value.log
58+ - match: ':'
59+ scope: punctuation.separator.sequence.log
60+ - match: ''
61+ pop: true
62+ numbers:
63+ - match: (0x)(\h+)(?:(\.)(\h+))?
64+ scope: meta.number.float.hexadecimal.log
65+ captures:
66+ 1: constant.numeric.base.log
67+ 2: constant.numeric.value.log
68+ 3: constant.numeric.value.log punctuation.separator.decimal.log
69+ 4: constant.numeric.value.log
70+ - match: \b\d+(\.)\d+\b
71+ scope: meta.number.float.log constant.numeric.value.log
72+ captures:
73+ 1: punctuation.separator.decimal.log
74+ - match: \b\d+\b
75+ scope: meta.number.integer.log constant.numeric.value.log
76+ url-host:
77+ - meta_content_scope: markup.underline.link.host.log
78+ - match: \[
79+ scope: punctuation.section.brackets.begin.log
80+ push:
81+ - match: \]
82+ scope: punctuation.section.brackets.end.log
83+ pop: true
84+ - include: ip_addresses
85+ - match: '[^:/\s]+'
86+ - match: ''
87+ set: url-after-host
88+ url-after-host:
89+ - match: (:)(\d+)
90+ scope: markup.underline.link.port.log
91+ captures:
92+ 1: punctuation.separator.mapping.port.log
93+ 2: constant.numeric.value.log
94+ #- include: scope:text.html.markdown#url-escaped-chars
95+ - match: (%)\h{2}
96+ scope: markup.underline.link.path.log constant.character.escape.url.log
97+ captures:
98+ 1: punctuation.definition.escape.log
99+ # After a valid domain, zero or more non-space non-< characters may follow
100+ - 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
101+ pop: true
102+ - 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
103+ push:
104+ - meta_scope: markup.underline.link.path.log
105+ - match: (?=[?!.,:*_~]*[\s<])
106+ pop: true
107+ - match: \)
108+ pop: true
109+ - match: (?=\)[?!.,:*_~]*[\s<])
110+ pop: true
111+ - match: '[^?!.,:*_~\s<&()%]+|\S'
112+ scope: markup.underline.link.path.log
113+ - match: ''
114+ pop: true