예제 #1
0
 private object[] GetArgs(CommonTree args)
 {
     if (args.Children == null || args.Children.Count < 1)
         return null;
     var fnArgs = (CommonTree) args.Children[0];
     var arr = new object[fnArgs.Children.Count];
     for (var i = 0; i < fnArgs.Children.Count; i++)
     {
         var exp = new Expression(fnArgs.Children[i]);
         ITemplateType o;
         Errors.AddRange(exp.Eval(Ctx, Interpreter, out o));
         if (Errors.ContainsError())
             continue;
         arr[i] = o.RawValue;
     }
     return arr;
 }
예제 #2
0
 private ITemplateType EvalPassThrough(CommonTree p)
 {
     if (p.Children == null || p.Children.Count < 1)
         return StringType.Empty();
     var args = (CommonTree) p.Children[0];
     if (args.Children == null || args.Children.Count < 1)
         return StringType.Empty();
     var buffer = new StringBuilder();
     foreach (var t in args.Children)
     {
         var exp = new Expression(t);
         ITemplateType o;
         Errors.AddRange(exp.Eval(Ctx, Interpreter, out o));
         if (Errors.ContainsError())
             continue;
         o.WriteTo(buffer);
     }
     return StringType.New(buffer.ToString());
 }