33 lines
787 B
C#
33 lines
787 B
C#
using System;
|
|
|
|
namespace AspClassic.Parser;
|
|
|
|
/// <summary>
|
|
/// A parse tree for a string literal expression.
|
|
/// </summary>
|
|
public sealed class StringLiteralExpression : LiteralExpression
|
|
{
|
|
private readonly string _Literal;
|
|
|
|
/// <summary>
|
|
/// The literal value.
|
|
/// </summary>
|
|
public string Literal => _Literal;
|
|
|
|
public override object Value => _Literal;
|
|
|
|
/// <summary>
|
|
/// Constructs a new string literal expression parse tree.
|
|
/// </summary>
|
|
/// <param name="literal">The literal value.</param>
|
|
/// <param name="span">The location of the parse tree.</param>
|
|
public StringLiteralExpression(string literal, Span span)
|
|
: base(TreeType.StringLiteralExpression, span)
|
|
{
|
|
if (literal == null)
|
|
{
|
|
throw new ArgumentNullException("literal");
|
|
}
|
|
_Literal = literal;
|
|
}
|
|
}
|