Exception: Rubycc::Front::LexError
- Inherits:
-
StandardError
- Object
- StandardError
- Rubycc::Front::LexError
- 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
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
Instance Method Summary collapse
-
#initialize(message, offset) ⇒ LexError
constructor
A new instance of LexError.
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(, offset) @offset = offset super() end |
Instance Attribute Details
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
13 14 15 |
# File 'lib/rubycc/front/lexeme_reader.rb', line 13 def offset @offset end |