Class: Omnium::Parser::AST::Identifier

Inherits:
Base
  • Object
show all
Defined in:
lib/omnium/parser/ast/identifier.rb

Overview

This node represents a variable or an identifier, accepting an ID token.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ Identifier

Returns a new instance of Identifier.



10
11
12
13
# File 'lib/omnium/parser/ast/identifier.rb', line 10

def initialize(token)
  @token = token # for convenience, though no getter for this
  @name = token.value
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/omnium/parser/ast/identifier.rb', line 8

def name
  @name
end