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

40 lines
897 B
C#

using System;
namespace AspClassic.Parser;
/// <summary>
/// A parse tree for a comment.
/// </summary>
public sealed class Comment : Tree
{
private readonly string _Comment;
private readonly bool _IsREM;
/// <summary>
/// The text of the comment.
/// </summary>
public string VComment => _Comment;
/// <summary>
/// Whether the comment is a REM comment.
/// </summary>
public bool IsREM => _IsREM;
/// <summary>
/// Constructs a new comment parse tree.
/// </summary>
/// <param name="comment">The text of the comment.</param>
/// <param name="isREM">Whether the comment is a REM comment.</param>
/// <param name="span">The location of the parse tree.</param>
public Comment(string comment, bool isREM, Span span)
: base(TreeType.Comment, span)
{
if (comment == null)
{
throw new ArgumentNullException("comment");
}
_Comment = comment;
_IsREM = isREM;
}
}