/// <summary> /// Creates a map expression from the parameters supplied. /// </summary> /// <param name="items"></param> /// <param name="token"></param> /// <returns></returns> public static Expr Map(List <Tuple <string, Expr> > items, TokenData token) { var exp = new MapExpr(); exp.Expressions = items; SetupContext(exp, token); return(exp); }
// index here /// <summary> /// Evaluate /// </summary> /// <returns></returns> public object VisitMap(MapExpr expr) { var mapExprs = expr.Expressions; // Case 2: Map type var dictionary = new Dictionary <string, object>(); foreach (var pair in mapExprs) { var expression = pair.Item2; object result = expression == null ? null : expression.Evaluate(this); dictionary[pair.Item1] = result; } var map = new LMap(dictionary); return(map); }
/// <summary> /// Visits the function call expression tree /// </summary> /// <param name="exp"></param> public object VisitMap(MapExpr exp) { return(null); }