using System;
namespace AspClassic.Parser;
///
/// A floating point literal.
///
public sealed class FloatingPointLiteralToken : Token
{
private readonly double _Literal;
private readonly TypeCharacter _TypeCharacter;
///
/// The value of the literal.
///
public double Literal => _Literal;
///
/// The type character after the literal.
///
public TypeCharacter TypeCharacter => _TypeCharacter;
///
/// Constructs a new floating point literal token.
///
/// The literal value.
/// The type character of the literal.
/// The location of the literal.
public FloatingPointLiteralToken(double literal, TypeCharacter typeCharacter, Span span)
: base(TokenType.FloatingPointLiteral, span)
{
if (typeCharacter != 0 && typeCharacter != TypeCharacter.SingleSymbol && typeCharacter != TypeCharacter.SingleChar && typeCharacter != TypeCharacter.DoubleSymbol && typeCharacter != TypeCharacter.DoubleChar)
{
throw new ArgumentOutOfRangeException("typeCharacter");
}
_Literal = literal;
_TypeCharacter = typeCharacter;
}
}