public override void Init(Irony.Ast.AstContext context, Irony.Parsing.ParseTreeNode treeNode) { base.Init(context, treeNode); var nodes = treeNode.ChildNodes; if (nodes.Count != 2) { throw new Exception("FunctionLiteral expected 2 children, received {0}".SafeFormat(nodes.Count)); } _arguments = AddChild(string.Empty, nodes[0]) as MtArgListForDecl; if (_arguments == null) { throw new Exception("List of arguments can't be null!"); } _body = AddChild(string.Empty, nodes[1]) as AstNode; if (_body == null) { throw new Exception("Body of function can't be null!");/*v*/ } }
public MtFunctionObject(AstNode body, MtArgListForDecl arguments, ScriptThread thread) { _body = body; _args = arguments; _thread = thread; }
public MtFunctionObject(AstNode body, MtArgListForDecl arguments) : this(body, arguments, null) { }