public static DeferredSection ( HandlebarsDotNet.Compiler.PathExpression path, System.Linq.Expressions.BlockExpression body, System.Linq.Expressions.BlockExpression inversion ) : HandlebarsDotNet.Compiler.DeferredSectionExpression | ||
path | HandlebarsDotNet.Compiler.PathExpression | |
body | System.Linq.Expressions.BlockExpression | |
inversion | System.Linq.Expressions.BlockExpression | |
Résultat | HandlebarsDotNet.Compiler.DeferredSectionExpression |
protected virtual Expression VisitDeferredSectionExpression(DeferredSectionExpression dsex) { PathExpression path = (PathExpression)Visit(dsex.Path); // Don't visit Body/Inversion - they will be compiled separately if (path != dsex.Path) { return(HandlebarsExpression.DeferredSection(path, dsex.Body, dsex.Inversion)); } return(dsex); }
public override bool IsClosingElement(Expression item) { if (IsClosingNode(item)) { var evalMode = _startingNode.Path.StartsWith("#") ? SectionEvaluationMode.NonEmpty : SectionEvaluationMode.Empty; _accumulatedExpression = HandlebarsExpression.DeferredSection( _startingNode, _body, evalMode); return(true); } else { return(false); } }
public override Expression GetAccumulatedBlock() { if (_accumulatedBody == null) { _accumulatedBody = Expression.Block(_body); _accumulatedInversion = Expression.Block(Expression.Empty()); } else if (_accumulatedInversion == null && _body.Any()) { _accumulatedInversion = Expression.Block(_body); } else { _accumulatedInversion = Expression.Block(Expression.Empty()); } return(HandlebarsExpression.DeferredSection( _startingNode, _accumulatedBody, _accumulatedInversion)); }