Class: Koto::Parser::AST::Node

Inherits:
Parser::AST::Node
  • Object
show all
Defined in:
lib/koto/parser/ast/node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



8
9
10
# File 'lib/koto/parser/ast/node.rb', line 8

def context
  @context
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/koto/parser/ast/node.rb', line 7

def name
  @name
end

#symbolsObject (readonly)

Returns the value of attribute symbols.



9
10
11
# File 'lib/koto/parser/ast/node.rb', line 9

def symbols
  @symbols
end

Instance Method Details

#accessObject



15
16
17
# File 'lib/koto/parser/ast/node.rb', line 15

def access
  context.access
end

#assign_properties(properties) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/koto/parser/ast/node.rb', line 19

def assign_properties(properties)
  super

  if (name = properties[:name])
    @name = name
  end

  if (context = properties[:context])
    @context = context
  end

  if (symbols = properties[:symbols])
    @symbols = symbols
  end
end

#parent_scopeObject



11
12
13
# File 'lib/koto/parser/ast/node.rb', line 11

def parent_scope
  context.current_scope
end