class TexLogParser::StandardError
Matches messages of this form:
! File ended while scanning use of \@footnotetext. <inserted text> \par <*> plain.tex
and
! Font TU/NoSuchFont(0)/m/n/9=NoSuchFont at 9.0pt not loadable: Metric (TFM) fi le or installed font not found. <to be read again> relax l.40 \end{document}
Public Class Methods
new()
click to toggle source
Creates a new instance.
Calls superclass method
LogParser::RegExpPattern::new
# File lib/tex_log_parser/patterns/standard_error.rb, line 22 def initialize super(/^! \w+/, { pattern: ->(_) { /^\s*<\*>\s+([^\s]+)|^l\.(\d+)\s+/ }, until: :match, inclusive: true } ) 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/standard_error.rb, line 29 def read(lines) # @type [Message] msg msg, consumed = super(lines) msg.level = :error # Remove last line msg.message.gsub!(@ending[:pattern][nil], '') # Remove `! ` prefix msg.message.sub!(/^!\s*/, '') # Remove trailing whitespace msg.message.rstrip! file = @end_match[1] line = @end_match[2].to_i msg.source_file = file unless file.nil? msg.source_lines = { from: line, to: line } unless line.nil? || line.zero? msg.preformatted = true [msg, consumed] end