aspclassic-core/AspClassic.Parser/CommentToken.cs
Jelle Luteijn 484dbfc9d9 progress
2022-05-15 11:19:49 +02:00

40 lines
889 B
C#

using System;
namespace AspClassic.Parser;
/// <summary>
/// A comment token.
/// </summary>
public sealed class CommentToken : Token
{
private readonly bool _IsREM;
private readonly string _Comment;
/// <summary>
/// Whether the comment was preceded by REM.
/// </summary>
public bool IsREM => _IsREM;
/// <summary>
/// The text of the comment.
/// </summary>
public string Comment => _Comment;
/// <summary>
/// Constructs a new comment token.
/// </summary>
/// <param name="comment">The comment value.</param>
/// <param name="isREM">Whether the comment was preceded by REM.</param>
/// <param name="span">The location of the comment.</param>
public CommentToken(string comment, bool isREM, Span span)
: base(TokenType.Comment, span)
{
if (comment == null)
{
throw new ArgumentNullException("comment");
}
_IsREM = isREM;
_Comment = comment;
}
}