public void Visit(LiquidExpressionTree liquidExpressionTree) { var result = LiquidExpressionEvaluator.Eval(liquidExpressionTree, _templateContext); result.WhenSuccess(success => success.WhenSome(x => AppendTextToCurrentAccumulator(Render(x)))) .WhenError(error => { RegisterRenderingError(error); //RenderingErrors.Add(error); //RenderError(error); }); }
public static LiquidExpressionResult Eval( LiquidExpressionTree expressiontree, ITemplateContext templateContext) { // Evaluate the children, depth first var leaves = expressiontree.ExpressionTree.Children.Select(x => Eval(x, templateContext)).ToList(); if (leaves.Any(x => x.IsError)) { return leaves.First(x => x.IsError); // TODO: maybe aggregate tehse } // pass the results to the parent return Eval(expressiontree.ExpressionTree.Data, leaves.Select(x => x.SuccessResult), templateContext); }
public static LiquidExpressionResult Eval( LiquidExpressionTree expressiontree, ITemplateContext templateContext) { // Evaluate the children, depth first var leaves = expressiontree.ExpressionTree.Children.Select(x => Eval(x, templateContext)).ToList(); if (leaves.Any(x => x.IsError)) { return(leaves.First(x => x.IsError)); // TODO: maybe aggregate tehse } // pass the results to the parent return(Eval(expressiontree.ExpressionTree.Data, leaves.Select(x => x.SuccessResult), templateContext)); }
public void Visit(LiquidExpressionTree liquidExpressionTree) { _result += liquidExpressionTree.ToString(); }
public void Visit(LiquidExpressionTree liquidExpressionTree) { LiquidExpressionEvaluator.Eval(liquidExpressionTree, _templateContext) .WhenSuccess(success => success.WhenSome(x => AppendTextToCurrentAccumulator(Render(x)))) .WhenError(RenderError); }