public FuncLiteral(Parameters parameters, FunBody funBody) : base(NodeType.FunctionalLiteralNode) { this.parameters = parameters; this.funBody = funBody; children = new List <BaseNode>(); children.Add(funBody); }
private FunBody parseFunBody(List <string> tokens) { //Console.WriteLine("Inside parse Fun Body"); //printList(tokens); if (tokens[0] == "is_t") { var body = new FunBody(FuncType.Complex); body.setBody(parseBody(tokens.GetRange(2, tokens.Count - 4))); return(body); } else { var body = new FunBody(FuncType.Expr); body.setExpr(parseExpression(tokens.GetRange(1, tokens.Count - 1))); return(body); } }