using System; namespace AspClassic.Parser; /// /// A parse tree for a decimal literal expression. /// public sealed class DecimalLiteralExpression : LiteralExpression { private readonly decimal _Literal; private readonly TypeCharacter _TypeCharacter; /// /// The literal value. /// public decimal 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 value. /// The location of the parse tree. public DecimalLiteralExpression(decimal literal, TypeCharacter typeCharacter, Span span) : base(TreeType.DecimalLiteralExpression, span) { if (typeCharacter != 0 && typeCharacter != TypeCharacter.DecimalChar && typeCharacter != TypeCharacter.DecimalSymbol) { throw new ArgumentOutOfRangeException("typeCharacter"); } _Literal = literal; _TypeCharacter = typeCharacter; } }