using System;
namespace AspClassic.Parser;
///
/// A parse tree for a floating point literal.
///
public sealed class FloatingPointLiteralExpression : LiteralExpression
{
private readonly double _Literal;
private readonly TypeCharacter _TypeCharacter;
///
/// The literal value.
///
public double Literal => _Literal;
public override object Value => _Literal;
///
/// The type character on the literal value.
///
public TypeCharacter TypeCharacter => _TypeCharacter;
///
/// Constructs a new parse tree for a floating point literal.
///
/// The literal value.
/// The type character on the literal.
/// The location of the parse tree.
public FloatingPointLiteralExpression(double literal, TypeCharacter typeCharacter, Span span)
: base(TreeType.FloatingPointLiteralExpression, span)
{
if (typeCharacter != 0 && typeCharacter != TypeCharacter.SingleSymbol && typeCharacter != TypeCharacter.SingleChar && typeCharacter != TypeCharacter.DoubleSymbol && typeCharacter != TypeCharacter.DoubleChar)
{
throw new ArgumentOutOfRangeException("typeCharacter");
}
_Literal = literal;
_TypeCharacter = typeCharacter;
}
}