tex_log_parser 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28e9ec16cce7e4b9235b4869500949e5428e396fa90433d39f815ec043bc5c85
|
4
|
+
data.tar.gz: ec53f7883d2c0f2d0fa907e0c5735351fd134c34de6ef43aa72398db817eee78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e86c1b1dcc3a89f234efbc5c63a6edc83e0d52fcfadbe5fd07abf3d39bcdbb3134a050a3ab7f6562a7991120f93ab920ba9f2964b007fa06aae7c08a1ad366c
|
7
|
+
data.tar.gz: 5d9422595057cf972305896c5ba25852b35d5fc18cfe93b1cd9f4640de8fc12b323911281eb1c4ed3d46b675be8a6ba0fffedb46dccc73dfa77a29c326ea2eea
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class TexLogParser
|
4
|
-
# Matches messages of these forms:
|
4
|
+
# Matches messages as produces by LaTeX 3, i.e. those of these forms:
|
5
5
|
#
|
6
6
|
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
7
7
|
# !
|
@@ -38,17 +38,30 @@ class TexLogParser
|
|
38
38
|
# .
|
39
39
|
# . Defining command \fontspec with sig. 'O{}mO{}' on line 472.
|
40
40
|
# .................................................
|
41
|
+
#
|
42
|
+
# and
|
43
|
+
#
|
44
|
+
# *************************************************
|
45
|
+
# * widows-and-orphans warning: "orphan-widow"
|
46
|
+
# *
|
47
|
+
# * Orphan on page 1 (second column) and widow on page 2 (first column)
|
48
|
+
# *************************************************
|
41
49
|
class HighlightedMessages
|
42
50
|
include LogParser::RegExpPattern
|
43
51
|
|
44
52
|
# Creates a new instance.
|
45
53
|
def initialize
|
46
|
-
super(/^(!{3,}|\.{3,})$/,
|
54
|
+
super(/^(!{3,}|\.{3,}|\*{3,})$/,
|
47
55
|
{ pattern: lambda { |m|
|
48
|
-
|
56
|
+
case m[1][0]
|
57
|
+
when '!'
|
49
58
|
/^l\.(\d+)/
|
50
|
-
|
59
|
+
when '*'
|
60
|
+
/^\*{3,}\s*$/
|
61
|
+
when '.'
|
51
62
|
/^\.{3,}\s*$/
|
63
|
+
else
|
64
|
+
raise("Expected one of `[!.*]` but found: #{m[1][0]}")
|
52
65
|
end
|
53
66
|
},
|
54
67
|
until: :match,
|
@@ -89,14 +102,14 @@ class TexLogParser
|
|
89
102
|
msg.source_lines = { from: line, to: line }
|
90
103
|
end
|
91
104
|
|
92
|
-
msg.level = :info
|
105
|
+
msg.level = @start_match[1][0] == '*' ? :warning : :info
|
93
106
|
|
94
107
|
msg.message.gsub!(@end_match[0], '')
|
95
108
|
end
|
96
109
|
|
97
110
|
msg.preformatted = true
|
98
|
-
msg.message.
|
99
|
-
msg.message.gsub!(/^#{@start_match[1][0]}\s+/, '')
|
111
|
+
msg.message.sub!(@start, '')
|
112
|
+
msg.message.gsub!(/^#{Regexp.escape(@start_match[1][0])}\s+/, '')
|
100
113
|
msg.message.strip!
|
101
114
|
|
102
115
|
[msg, consumed]
|
@@ -47,7 +47,10 @@ class TexLogParser
|
|
47
47
|
msg.source_lines = { from: line, to: line }
|
48
48
|
end
|
49
49
|
|
50
|
-
#
|
50
|
+
# Remove uninformative line prefixes (e.g. `(tocbasic)`)
|
51
|
+
unless @start_match[2].nil?
|
52
|
+
msg.message.gsub!(@ending[:pattern][@start_match], ' ' * (@start_match[2].length + 2))
|
53
|
+
end
|
51
54
|
|
52
55
|
[msg, consumed]
|
53
56
|
end
|
data/lib/version.rb
CHANGED
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
|
4
|
+
version: 1.1.0
|
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-
|
11
|
+
date: 2018-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: github-markup
|
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
153
|
version: '0'
|
154
154
|
requirements: []
|
155
155
|
rubyforge_project:
|
156
|
-
rubygems_version: 2.7.
|
156
|
+
rubygems_version: 2.7.7
|
157
157
|
signing_key:
|
158
158
|
specification_version: 4
|
159
159
|
summary: Parses log files of (La)TeX engines
|