tex_log_parser 1.0.0.pre.7 → 1.0.0.pre.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tex_log_parser/log_parser.rb +1 -0
- data/lib/tex_log_parser/log_pattern.rb +3 -2
- data/lib/tex_log_parser/patterns/bad_hbox_warning.rb +17 -1
- data/lib/tex_log_parser/patterns/exclaiming_error.rb +32 -0
- data/lib/tex_log_parser/patterns/fatal_error_occurred.rb +25 -0
- data/lib/tex_log_parser/patterns/runaway_parameter_error.rb +18 -2
- data/lib/tex_log_parser/version.rb +1 -1
- data/lib/tex_log_parser.rb +7 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a31484789a537268e2bcd739ff74fac6b946068
|
4
|
+
data.tar.gz: a0bce484490571886b62aa1434f3ea4c625dbd0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6f9094ef608e78610997a5ed04ee3c01ee8e9d53bf942cf263c2b4e6378ee4193b3f8b39b77d69440591d6365d4a013e23c273bcdc2fb5a8abd0c10693081e9
|
7
|
+
data.tar.gz: 623cd9d97a032617e669edaa71e171e70195fc71eb2480afd316387c01cfc9390dad80822dd680c8536b30ced3964760d3f7e6c7621fe8d83cd08c565eb46609
|
@@ -46,8 +46,9 @@ module RegExpPattern
|
|
46
46
|
|
47
47
|
# TODO: document
|
48
48
|
def ends_at?(line)
|
49
|
-
match =
|
50
|
-
|
49
|
+
match = @ending[:pattern][@start_match].match(line)
|
50
|
+
@end_match = match unless match.nil?
|
51
|
+
!match.nil? == (@ending[:until] == :match)
|
51
52
|
end
|
52
53
|
|
53
54
|
# TODO: make failable (e.g. EOF)
|
@@ -4,5 +4,21 @@
|
|
4
4
|
class BadHboxWarning
|
5
5
|
include RegExpPattern
|
6
6
|
|
7
|
-
|
7
|
+
def initialize
|
8
|
+
super(/^(Over|Under)full \\hbox.*at lines (\d+)--(\d+)/,
|
9
|
+
{ pattern: ->(_) { /^\s*\[\]\s*$/ }, until: :match, inclusive: false }
|
10
|
+
)
|
11
|
+
end
|
12
|
+
|
13
|
+
def read(lines)
|
14
|
+
# @type [LogMessage] msg
|
15
|
+
msg, consumed = super(lines)
|
16
|
+
|
17
|
+
msg.source_lines = { from: @start_match[2].to_i,
|
18
|
+
to: @start_match[3].to_i }
|
19
|
+
msg.preformatted = true
|
20
|
+
msg.level = :warning
|
21
|
+
|
22
|
+
[msg, consumed]
|
23
|
+
end
|
8
24
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Matches messages of this form:
|
4
|
+
#
|
5
|
+
# ! File ended while scanning use of \@footnotetext.
|
6
|
+
# <inserted text>
|
7
|
+
# \par
|
8
|
+
# <*> plain.tex
|
9
|
+
class ExclaimingError
|
10
|
+
include RegExpPattern
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
super(/^\! \w+/,
|
14
|
+
{ pattern: ->(_) { /^\s*<\*>\s+([^\s]+)/ }, until: :match, inclusive: true }
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
def read(lines)
|
19
|
+
# @type [LogMessage] msg
|
20
|
+
msg, consumed = super(lines)
|
21
|
+
|
22
|
+
msg.level = :error
|
23
|
+
# Remove last line
|
24
|
+
msg.message.gsub!(@ending[:pattern][nil], '')
|
25
|
+
msg.message.rstrip!
|
26
|
+
|
27
|
+
msg.source_file = @end_match[1]
|
28
|
+
msg.preformatted = true
|
29
|
+
|
30
|
+
[msg, consumed]
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Matches messages of this form:
|
4
|
+
#
|
5
|
+
# ! ==> Fatal error occurred, no output PDF file produced!
|
6
|
+
# Transcript written on plain.log.
|
7
|
+
class FatalErrorOccurred
|
8
|
+
include RegExpPattern
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
super(/^\!\s+==>/,
|
12
|
+
{ pattern: ->(_) { /Transcript written/ }, until: :match, inclusive: true }
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
def read(lines)
|
17
|
+
# @type [LogMessage] msg
|
18
|
+
msg, consumed = super(lines)
|
19
|
+
|
20
|
+
msg.level = :error
|
21
|
+
msg.preformatted = false
|
22
|
+
|
23
|
+
[msg, consumed]
|
24
|
+
end
|
25
|
+
end
|
@@ -1,8 +1,24 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
3
|
+
# Matches messages of this form:
|
4
|
+
#
|
5
|
+
# Runaway argument?
|
6
|
+
# {Test. Also, it contains some \ref {warnings} and \ref {errors} for t\ETC.
|
4
7
|
class RunawayParameterError
|
5
8
|
include RegExpPattern
|
6
9
|
|
7
|
-
|
10
|
+
def initialize
|
11
|
+
super(/^Runaway argument\?/,
|
12
|
+
{ pattern: ->(_) { /./ }, until: :match, inclusive: true }
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
def read(lines)
|
17
|
+
# @type [LogMessage] msg
|
18
|
+
msg, consumed = super(lines)
|
19
|
+
|
20
|
+
msg.level = :error
|
21
|
+
|
22
|
+
[msg, consumed]
|
23
|
+
end
|
8
24
|
end
|
data/lib/tex_log_parser.rb
CHANGED
@@ -12,12 +12,17 @@ class TexLogParser
|
|
12
12
|
include LogParser
|
13
13
|
|
14
14
|
def patterns
|
15
|
-
[FileLineError.new,
|
15
|
+
[FileLineError.new,
|
16
|
+
PrefixedMultiLinePattern.new,
|
17
|
+
RunawayParameterError.new,
|
18
|
+
ExclaimingError.new,
|
19
|
+
FatalErrorOccurred.new,
|
20
|
+
BadHboxWarning.new]
|
16
21
|
end
|
17
22
|
|
18
23
|
def scope_changes(line)
|
19
24
|
case line
|
20
|
-
when /^\s*\(([^()]*)\)\s
|
25
|
+
when /^\s*\(([^()]*)\)\s*(.*)$/
|
21
26
|
# A scope opened and closed immediately -- log it, then
|
22
27
|
# continue with rest of the line (there can be multiple such
|
23
28
|
# things in one line, see e.g. 000.log:656)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tex_log_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.pre.
|
4
|
+
version: 1.0.0.pre.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Raphael Reitzig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -83,6 +83,8 @@ files:
|
|
83
83
|
- lib/tex_log_parser/log_parser.rb
|
84
84
|
- lib/tex_log_parser/log_pattern.rb
|
85
85
|
- lib/tex_log_parser/patterns/bad_hbox_warning.rb
|
86
|
+
- lib/tex_log_parser/patterns/exclaiming_error.rb
|
87
|
+
- lib/tex_log_parser/patterns/fatal_error_occurred.rb
|
86
88
|
- lib/tex_log_parser/patterns/file_line_error.rb
|
87
89
|
- lib/tex_log_parser/patterns/fontspec_error.rb
|
88
90
|
- lib/tex_log_parser/patterns/prefixed_multi_line_pattern.rb
|