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