progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
31
AspClassic.Parser/ErrorToken.cs
Normal file
31
AspClassic.Parser/ErrorToken.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
|
||||
namespace AspClassic.Parser;
|
||||
|
||||
/// <summary>
|
||||
/// A lexical error.
|
||||
/// </summary>
|
||||
public sealed class ErrorToken : Token
|
||||
{
|
||||
private readonly SyntaxError _SyntaxError;
|
||||
|
||||
/// <summary>
|
||||
/// The syntax error that represents the lexical error.
|
||||
/// </summary>
|
||||
public SyntaxError SyntaxError => _SyntaxError;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new lexical error token.
|
||||
/// </summary>
|
||||
/// <param name="errorType">The type of the error.</param>
|
||||
/// <param name="span">The location of the error.</param>
|
||||
public ErrorToken(SyntaxErrorType errorType, Span span)
|
||||
: base(TokenType.LexicalError, span)
|
||||
{
|
||||
if (errorType < SyntaxErrorType.InvalidEscapedIdentifier || errorType > SyntaxErrorType.InvalidDecimalLiteral)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("errorType");
|
||||
}
|
||||
_SyntaxError = new SyntaxError(errorType, span);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue