Exception: Flexr::LexError

Inherits:
Error
  • Object
show all
Defined in:
lib/flexr/errors.rb

Instance Attribute Summary collapse

Attributes inherited from Error

#diagnostic

Instance Method Summary collapse

Constructor Details

#initialize(message, filename: nil, byte_pos: nil, line: nil, text: nil, diagnostic: nil) ⇒ LexError

Returns a new instance of LexError.



16
17
18
19
20
21
22
# File 'lib/flexr/errors.rb', line 16

def initialize(message, filename: nil, byte_pos: nil, line: nil, text: nil, diagnostic: nil)
  @filename = filename
  @byte_pos = byte_pos
  @line = line
  @text = text
  super(message, diagnostic: diagnostic)
end

Instance Attribute Details

#byte_posObject (readonly)

Returns the value of attribute byte_pos.



14
15
16
# File 'lib/flexr/errors.rb', line 14

def byte_pos
  @byte_pos
end

#filenameObject (readonly)

Returns the value of attribute filename.



14
15
16
# File 'lib/flexr/errors.rb', line 14

def filename
  @filename
end

#lineObject (readonly)

Returns the value of attribute line.



14
15
16
# File 'lib/flexr/errors.rb', line 14

def line
  @line
end

#textObject (readonly)

Returns the value of attribute text.



14
15
16
# File 'lib/flexr/errors.rb', line 14

def text
  @text
end