Class: IV::Phonic::AST::Identifier
- Inherits:
-
Literal
- Object
- Node
- Expression
- Literal
- IV::Phonic::AST::Identifier
- Defined in:
- lib/iv/phonic/ast.rb
Instance Method Summary collapse
-
#initialize(parent, expr) ⇒ Identifier
constructor
A new instance of Identifier.
- #to_source(lv) ⇒ Object
Methods inherited from Expression
Methods inherited from Node
#begin_position, #end_position, #program, #source
Constructor Details
#initialize(parent, expr) ⇒ Identifier
Returns a new instance of Identifier.
369 370 371 372 373 |
# File 'lib/iv/phonic/ast.rb', line 369 def initialize parent, expr super parent, expr @value = expr[:value] @kind = expr[:kind] end |
Instance Method Details
#to_source(lv) ⇒ Object
375 376 377 378 379 380 381 |
# File 'lib/iv/phonic/ast.rb', line 375 def to_source lv if @kind == :STRING || @kind == :NUMBER source.slice(begin_position, end_position) else @value end end |