Class: StyleScript::ThrowNode

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

Overview

Throw an exception.

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(expression) ⇒ ThrowNode

Returns a new instance of ThrowNode.



940
941
942
# File 'lib/style_script/nodes.rb', line 940

def initialize(expression)
  @expression = expression
end

Instance Method Details

#compile_node(o) ⇒ Object



944
945
946
# File 'lib/style_script/nodes.rb', line 944

def compile_node(o)
  write("#{idt}throw #{@expression.compile(o)};")
end