progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
42
AspClassic.Parser/DecimalLiteralExpression.cs
Normal file
42
AspClassic.Parser/DecimalLiteralExpression.cs
Normal file
|
@ -0,0 +1,42 @@
|
|||
using System;
|
||||
|
||||
namespace AspClassic.Parser;
|
||||
|
||||
/// <summary>
|
||||
/// A parse tree for a decimal literal expression.
|
||||
/// </summary>
|
||||
public sealed class DecimalLiteralExpression : LiteralExpression
|
||||
{
|
||||
private readonly decimal _Literal;
|
||||
|
||||
private readonly TypeCharacter _TypeCharacter;
|
||||
|
||||
/// <summary>
|
||||
/// The literal value.
|
||||
/// </summary>
|
||||
public decimal Literal => _Literal;
|
||||
|
||||
public override object Value => _Literal;
|
||||
|
||||
/// <summary>
|
||||
/// The type character on the literal value.
|
||||
/// </summary>
|
||||
public TypeCharacter TypeCharacter => _TypeCharacter;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new parse tree for a floating point literal.
|
||||
/// </summary>
|
||||
/// <param name="literal">The literal value.</param>
|
||||
/// <param name="typeCharacter">The type character on the literal value.</param>
|
||||
/// <param name="span">The location of the parse tree.</param>
|
||||
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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue