using System; namespace AspClassic.Parser; /// /// A decimal literal token. /// public sealed class DecimalLiteralToken : Token { private readonly decimal _Literal; private readonly TypeCharacter _TypeCharacter; /// /// The literal value. /// public decimal Literal => _Literal; /// /// The type character of the literal. /// public TypeCharacter TypeCharacter => _TypeCharacter; /// /// Constructs a new decimal literal token. /// /// The literal value. /// The literal's type character. /// The location of the literal. public DecimalLiteralToken(decimal literal, TypeCharacter typeCharacter, Span span) : base(TokenType.DecimalLiteral, span) { if (typeCharacter != 0 && typeCharacter != TypeCharacter.DecimalChar && typeCharacter != TypeCharacter.DecimalSymbol) { throw new ArgumentOutOfRangeException("typeCharacter"); } _Literal = literal; _TypeCharacter = typeCharacter; } }