Class: NScript::IndexNode

Inherits:
Node
  • Object
show all
Defined in:
lib/nscript/parser/nodes.rb

Constant Summary

Constants inherited from Node

Node::TAB

Instance Method Summary collapse

Methods inherited from Node

#children, children, #compile, #compile_closure, #contains?, #idt, statement, #statement?, statement_only, #statement_only?, top_sensitive, #top_sensitive?, #unwrap, #write

Constructor Details

#initialize(index) ⇒ IndexNode

Returns a new instance of IndexNode.



361
362
363
# File 'lib/nscript/parser/nodes.rb', line 361

def initialize(index)
  @index = index
end

Instance Method Details

#compile_node(o) ⇒ Object



365
366
367
# File 'lib/nscript/parser/nodes.rb', line 365

def compile_node(o)
  write("[#{@index.compile(o)}]")
end