Class: StyleScript::IndexNode

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

Overview

An indexed accessor into a part of an array or object.

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.



423
424
425
# File 'lib/style_script/nodes.rb', line 423

def initialize(index)
  @index = index
end

Instance Method Details

#compile_node(o) ⇒ Object



427
428
429
# File 'lib/style_script/nodes.rb', line 427

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