/// <summary>
        /// Initializes a new instance of <see cref="GreenPgnTriviaElementSyntax"/>.
        /// </summary>
        /// <param name="backgroundBefore">
        /// The background symbols which directly precede the comment foreground node.
        /// </param>
        /// <param name="commentNode">
        /// The foreground node which contains the comment.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="backgroundBefore"/> and/or <paramref name="commentNode"/> are null.
        /// </exception>
        public GreenPgnTriviaElementSyntax(IEnumerable <GreenPgnBackgroundSyntax> backgroundBefore, GreenPgnCommentSyntax commentNode)
        {
            if (backgroundBefore == null)
            {
                throw new ArgumentNullException(nameof(backgroundBefore));
            }

            BackgroundBefore = ReadOnlySpanList <GreenPgnBackgroundSyntax> .Create(backgroundBefore);

            CommentNode = commentNode ?? throw new ArgumentNullException(nameof(commentNode));
            Length      = BackgroundBefore.Length + CommentNode.Length;
        }
Exemple #2
0
 internal PgnCommentSyntax(PgnTriviaElementSyntax parent, GreenPgnCommentSyntax green)
 {
     Parent = parent;
     Green  = green;
 }