class TexLogParser::BadHboxWarning

Matches messages of this form:

Overfull \hbox (68.36201pt too wide) in paragraph at lines 33--34
[]\OT1/cmr/m/n/10 Let's try to for-ce an over-full box: []
[]

and

Underfull \hbox (badness 10000) in paragraph at lines 35--36

[]

Public Class Methods

new() click to toggle source

Creates a new instance.

Calls superclass method LogParser::RegExpPattern::new
# File lib/tex_log_parser/patterns/bad_hbox_warning.rb, line 19
def initialize
  super(/^(Over|Under)full \\hbox.*at line(?:s)? (\d+)(?:--(\d+))?/,
        { pattern: ->(_) { /^\s*(\[\])?\s*$/ }, until: :match, inclusive: false }
  )
end

Public Instance Methods

read(lines) click to toggle source

(see LogParser::RegExpPattern#read)

Calls superclass method LogParser::RegExpPattern#read
# File lib/tex_log_parser/patterns/bad_hbox_warning.rb, line 26
def read(lines)
  # @type [Message] msg
  msg, consumed = super(lines)

  from_line = @start_match[2].to_i
  end_line = @start_match[3].nil? ? from_line :  @start_match[3].to_i
  msg.source_lines = { from: from_line, to: end_line }
  msg.preformatted = true
  msg.level = :warning

  [msg, consumed]
end