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