Exemplo n.º 1
0
 private Func <IReadOnlyList <object>, object> GlobalTemplateFunction(string templateName)
 => (IReadOnlyList <object> args) =>
 {
     var evaluator = new Evaluator(AllTemplates.ToList(), ExpressionParser, LgOptions);
     var newScope  = evaluator.ConstructScope(templateName, args.ToList());
     return(evaluator.EvaluateTemplate(templateName, newScope));
 };
Exemplo n.º 2
0
 public Func <IReadOnlyList <object>, object> TemplateEvaluator(string templateName)
 => (IReadOnlyList <object> args) =>
 {
     var newScope = _evaluator.ConstructScope(templateName, args.ToList());
     return(_evaluator.EvaluateTemplate(templateName, newScope));
 };