tex_log_parser 1.0.0.pre.7 → 1.0.0.pre.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1771cd7fe895030d25eb1487e9af597b0617e5ff
4
- data.tar.gz: acb8d3e74d985533efd9e45b613dfcf086aaf75d
3
+ metadata.gz: 0a31484789a537268e2bcd739ff74fac6b946068
4
+ data.tar.gz: a0bce484490571886b62aa1434f3ea4c625dbd0f
5
5
  SHA512:
6
- metadata.gz: 740853668e14c12939f5284030a9adce6cc43e3eca3db4f837a3220d01a31734adaed14e87379fd16962472337c67a0148f38642f444672e7d4c40f84ead69b4
7
- data.tar.gz: c47346069d27184a711e51b66c63ac9a2c55f622f08f1b227173baa4808571909eafddddfab3c4493f338b8dab2be9068b3b9f939b69aba076f8972d4b32b6a4
6
+ metadata.gz: d6f9094ef608e78610997a5ed04ee3c01ee8e9d53bf942cf263c2b4e6378ee4193b3f8b39b77d69440591d6365d4a013e23c273bcdc2fb5a8abd0c10693081e9
7
+ data.tar.gz: 623cd9d97a032617e669edaa71e171e70195fc71eb2480afd316387c01cfc9390dad80822dd680c8536b30ced3964760d3f7e6c7621fe8d83cd08c565eb46609
@@ -43,6 +43,7 @@ module LogParser
43
43
  skip_empty_lines
44
44
  end
45
45
 
46
+ # TODO: Remove duplicates?
46
47
  @messages
47
48
  end
48
49
 
@@ -46,8 +46,9 @@ module RegExpPattern
46
46
 
47
47
  # TODO: document
48
48
  def ends_at?(line)
49
- match = !(@ending[:pattern][@start_match] =~ line).nil?
50
- match == (@ending[:until] == :match)
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
- # TODO: implement
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
- # TODO: document
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
- # TODO: implement
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class TexLogParser
4
- VERSION = '1.0.0.pre.7'
4
+ VERSION = '1.0.0.pre.9'
5
5
  end
@@ -12,12 +12,17 @@ class TexLogParser
12
12
  include LogParser
13
13
 
14
14
  def patterns
15
- [FileLineError.new, PrefixedMultiLinePattern.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.7
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-04 00:00:00.000000000 Z
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