class NScript::ClosureNode

Public Class Methods

wrap(expressions, statement=false) click to toggle source
# File lib/nscript/parser/nodes.rb, line 683
def self.wrap(expressions, statement=false)
  func = ParentheticalNode.new(CodeNode.new([], Expressions.wrap(expressions)))
  call = CallNode.new(ValueNode.new(func, AccessorNode.new(Value.new('call'))), [Value.new('this')])
  statement ? Expressions.wrap(call) : call
end