﻿using Veil.Parser;

namespace Veil.Compiler
{
    internal partial class VeilTemplateCompiler<T>
    {
        private void EmitWriteLiteral(SyntaxTreeNode.WriteLiteralNode node)
        {
            LoadWriterToStack();
            emitter.LoadConstant(node.LiteralContent);
            CallWriteFor(typeof(string));
        }
    }
}
﻿using Veil.Parser;

namespace Veil.Compiler
{
    internal partial class VeilTemplateCompiler<T>
    {
        private void EmitWriteLiteral(SyntaxTreeNode.WriteLiteralNode node)
        {
            if (string.IsNullOrEmpty(node.LiteralContent)) return;

            LoadWriterToStack();
            emitter.LoadConstant(node.LiteralContent);
            CallWriteFor(typeof(string));
        }
    }
}
Optimize away empty string literals.
Optimize away empty string literals.
