Exception: Rubycc::Front::LexError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/rubycc/front/lexeme_reader.rb

Overview

Raised while decoding the interior of a single lexeme (a numeric constant, a string/character literal). It is deliberately position-agnostic: it only names the problem and the character offset (into the text handed to the reader) where it occurred, leaving the caller to translate that offset into a source line/column for a user-facing CompileError. This lets the same decoder serve both the streaming Lexer (offsets into the whole source) and the preprocessor's converter (offsets into an isolated lexeme).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, offset) ⇒ LexError

Returns a new instance of LexError.



15
16
17
18
# File 'lib/rubycc/front/lexeme_reader.rb', line 15

def initialize(message, offset)
  @offset = offset
  super(message)
end

Instance Attribute Details

#offsetObject (readonly)

Returns the value of attribute offset.



13
14
15
# File 'lib/rubycc/front/lexeme_reader.rb', line 13

def offset
  @offset
end