Class: TexLogParser::FatalErrorOccurred

Inherits:
Object
  • Object
show all
Includes:
LogParser::RegExpPattern
Defined in:
lib/tex_log_parser/patterns/fatal_error_occurred.rb

Overview

Matches messages of this form:

!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on plain.log.

Instance Method Summary collapse

Methods included from LogParser::RegExpPattern

#begins_at?

Methods included from LogParser::Pattern

#begins_at?

Constructor Details

#initializeFatalErrorOccurred

Creates a new instance.



12
13
14
15
16
# File 'lib/tex_log_parser/patterns/fatal_error_occurred.rb', line 12

def initialize
  super(/^!\s+==>/,
        { pattern: ->(_) { /Transcript written/ }, until: :match, inclusive: true }
  )
end

Instance Method Details

#read(lines) ⇒ Array<(Message, Int)>

Reads a message from the given lines.

Parameters:

Returns:

  • (Array<(Message, Int)>)

    An array of the message that was read, and the number of lines that it spans.

Raises:

  • If no message end could be found among the given lines.



19
20
21
22
23
24
25
26
27
# File 'lib/tex_log_parser/patterns/fatal_error_occurred.rb', line 19

def read(lines)
  # @type [Message] msg
  msg, consumed = super(lines)

  msg.level = :error
  msg.preformatted = false

  [msg, consumed]
end