Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions Fluid/FluidParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ public class FluidParser
protected static readonly Parser<TagResult> TagStart = TagParsers.TagStart();
protected static readonly Parser<TagResult> TagStartSpaced = TagParsers.TagStart(true);
protected static readonly Parser<TagResult> TagEnd = TagParsers.TagEnd(true);


protected static readonly LiteralExpression EmptyKeyword = new LiteralExpression(EmptyValue.Instance);
protected static readonly LiteralExpression BlankKeyword = new LiteralExpression(BlankValue.Instance);
protected static readonly LiteralExpression TrueKeyword = new LiteralExpression(BooleanValue.True);
protected static readonly LiteralExpression FalseKeyword = new LiteralExpression(BooleanValue.False);

public FluidParser() : this (new())
{
}
Expand Down Expand Up @@ -120,10 +125,10 @@ public FluidParser(FluidParserOptions parserOptions)
{
switch ((x.Segments[0] as IdentifierSegment).Identifier)
{
case "empty": return new LiteralExpression(EmptyValue.Instance);
case "blank": return new LiteralExpression(BlankValue.Instance);
case "true": return new LiteralExpression(BooleanValue.True);
case "false": return new LiteralExpression(BooleanValue.False);
case "empty": return EmptyKeyword;
case "blank": return BlankKeyword;
case "true": return TrueKeyword;
case "false": return FalseKeyword;
}
}

Expand Down