Class: Astel::NodePattern::Lexer
- Inherits:
-
Object
- Object
- Astel::NodePattern::Lexer
- Defined in:
- lib/astel/node_pattern/lexer.rb
Constant Summary collapse
- SINGLE =
{ '(' => :lparen, ')' => :rparen, '{' => :lbrace, '}' => :rbrace, ':' => :colon, '$' => :capture }.freeze
Instance Method Summary collapse
-
#initialize(source) ⇒ Lexer
constructor
A new instance of Lexer.
- #tokens ⇒ Object
Constructor Details
#initialize(source) ⇒ Lexer
Returns a new instance of Lexer.
9 10 11 12 13 14 |
# File 'lib/astel/node_pattern/lexer.rb', line 9 def initialize(source) @source = source @index = 0 @line = 1 @column = 1 end |