Class: NScript::ThrowNode

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

Returns a new instance of ThrowNode.



809
810
811
# File 'lib/nscript/parser/nodes.rb', line 809

def initialize(expression)
  @expression = expression
end

Instance Method Details

#compile_node(o) ⇒ Object



813
814
815
# File 'lib/nscript/parser/nodes.rb', line 813

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