-
-
Notifications
You must be signed in to change notification settings - Fork 190
Expand file tree
/
Copy pathLiquidStatement.cs
More file actions
33 lines (27 loc) · 1.04 KB
/
LiquidStatement.cs
File metadata and controls
33 lines (27 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System.Text.Encodings.Web;
namespace Fluid.Ast
{
public sealed class LiquidStatement : TagStatement
{
public LiquidStatement(IReadOnlyList<Statement> statements) : base(statements)
{
}
public override async ValueTask<Completion> WriteToAsync(TextWriter writer, TextEncoder encoder, TemplateContext context)
{
context.IncrementSteps();
for (var i = 0; i < Statements.Count; i++)
{
var statement = Statements[i];
var completion = await statement.WriteToAsync(writer, encoder, context);
if (completion != Completion.Normal)
{
// Stop processing the block statements
// We return the completion to flow it to the outer loop
return completion;
}
}
return Completion.Normal;
}
protected internal override Statement Accept(AstVisitor visitor) => visitor.VisitLiquidStatement(this);
}
}