Class: Rux::DebugLexer
- Inherits:
-
Object
- Object
- Rux::DebugLexer
- Defined in:
- lib/rux/debug_lexer.rb
Instance Method Summary collapse
- #advance ⇒ Object
-
#initialize ⇒ DebugLexer
constructor
A new instance of DebugLexer.
- #source_buffer ⇒ Object
Constructor Details
#initialize ⇒ DebugLexer
Returns a new instance of DebugLexer.
3 4 5 6 7 |
# File 'lib/rux/debug_lexer.rb', line 3 def initialize(...) @lexer = Lexer.new(...) @tokens = @lexer.to_a @counter = -1 end |
Instance Method Details
#advance ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/rux/debug_lexer.rb', line 13 def advance @counter += 1 if @counter >= @tokens.size [nil, ['$eof']] else @tokens[@counter] end end |
#source_buffer ⇒ Object
9 10 11 |
# File 'lib/rux/debug_lexer.rb', line 9 def source_buffer @lexer.source_buffer end |