-
Notifications
You must be signed in to change notification settings - Fork 366
/
Copy pathLaTeXTools Log.sublime-syntax
179 lines (157 loc) · 4.49 KB
/
LaTeXTools Log.sublime-syntax
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
%YAML 1.2
---
name: LaTeXTools Log
scope: text.log.latex
first_line_match: '^This is (?:LuaHB|pdfe?|Xe)?TeXk?, Version '
################################################################################
contexts:
main:
- include: comments
- include: blocks
- include: strings
comments:
# note: primarily used for syntax_test files
- match: \#
scope: punctuation.definition.comment.log
push: comment-body
comment-body:
- meta_scope: comment.line.log
- match: $\n?
pop: true
###[ BLOCKS ]##################################################################
blocks:
# block begin with full file name
- match: (\()((?:\\.|[^\s?!*)])+\.[A-Za-z]{2,}\b)
captures:
1: punctuation.section.block.begin.log
2: meta.toc-list.log entity.name.section.filename.log
push:
- block-body
- block-comment
# block begin with wrapped file name
- match: (\()((?:\\.|[^\s?!*)])+\n)
captures:
1: punctuation.section.block.begin.log
2: meta.toc-list.log entity.name.section.filename.log
push:
- block-body
- block-comment
- filename-continuation
filename-continuation:
- match: ((?:\\.|[^\s?!*)])+\.[A-Za-z]{2,}\b)
scope: meta.toc-list.log entity.name.section.filename.log
pop: true
- match: (?=\S)
pop: true
block-body:
- meta_scope: meta.block.log
- match: \)
scope: punctuation.section.block.end.log
pop: true
- include: comments
- include: blocks
- include: groups
- include: log-entries
- include: commands
- include: strings
block-comment:
- match: '^Document Class:.{64}\n'
set: block-comment-body
- match: '^Document Class:.+'
scope: comment.line.log
pop: true
- match: '^File:.{74}\n'
set: block-comment-body
- match: '^File:.+'
scope: comment.line.log
pop: true
- match: '^Package:.{71}\n'
set: block-comment-body
- match: '^Package:.+'
scope: comment.line.log
pop: true
- match: ^|(?=\))
pop: true
block-comment-body:
- meta_scope: comment.line.log
- match: ^.{80}\n # consume anything which has 80 chars
- match: \n
pop: true
groups:
- match: \(
scope: punctuation.section.group.begin.log
push: group-body
group-body:
- meta_scope: meta.group.log
- match: \)
scope: punctuation.section.group.end.log
pop: true
- include: comments
- include: groups
- include: log-entries
- include: commands
- include: strings
###[ LOG ENTRIES ]##############################################################
log-entries:
# errors
- match: '^[^:]*Error:'
scope: markup.error.log
- match: '^!.*'
scope: markup.error.log
# warnings
- match: '^[^:]*(?:Overfull|Underfull)'
scope: markup.warning.log
push: box-warning-body
- match: '^[^:]*(FiXme|Warning):'
scope: markup.warning.log
- match: '^[^:]*:\d*:.*'
scope: markup.warning.log
# info
- match: '^[^:]*Info:'
scope: markup.info.log
box-warning-body:
- meta_scope: meta.warning.box.log
- match: ^\s*\[\]\n
scope: punctuation.terminator.log
pop: true
- include: comments
- include: groups
- include: commands
commands:
- match: (\\)[\w@]+
scope: support.function.latex
captures:
1: punctuation.definition.variable.latex
- match: :?=
scope: keyword.operator.assignment.latex
- match: ;
scope: punctuation.separator.latex
###[ STRINGS ]##################################################################
strings:
- match: '<<'
scope: punctuation.definition.string.begin.log
push: double-angled-string-body
- match: '<'
scope: punctuation.definition.string.begin.log
push: single-angled-string-body
- match: '`'
scope: punctuation.definition.string.begin.log
push: single-quoted-string-body
double-angled-string-body:
- meta_scope: string.quoted.other.log
- match: '>>'
scope: punctuation.definition.string.end.log
pop: true
single-angled-string-body:
- meta_scope: string.quoted.other.log
- match: '>'
scope: punctuation.definition.string.end.log
pop: true
single-quoted-string-body:
- meta_scope: string.quoted.single.log
- match: ''''
scope: punctuation.definition.string.end.log
pop: true
- match: \.$
scope: punctuation.definition.string.end.log
pop: true