Пример #1
0
        /// <summary>
        /// Initializes a new instance of <see cref="GreenPgnGameListSyntax"/>.
        /// </summary>
        /// <param name="games">
        /// The list of games.
        /// </param>
        /// <param name="trailingTrivia">
        /// The trailing trivia of the syntax node.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="games"/> and/or <paramref name="trailingTrivia"/> is null.
        /// </exception>
        public GreenPgnGameListSyntax(IEnumerable <GreenPgnGameSyntax> games, GreenPgnTriviaSyntax trailingTrivia)
        {
            if (games == null)
            {
                throw new ArgumentNullException(nameof(games));
            }
            Games = ReadOnlySpanList <GreenPgnGameSyntax> .Create(games);

            TrailingTrivia = trailingTrivia ?? throw new ArgumentNullException(nameof(trailingTrivia));
        }
Пример #2
0
        internal PgnTriviaSyntax(Union <WithTriviaSyntax, PgnGameListSyntax> parent, GreenPgnTriviaSyntax green)
        {
            Parent = parent;
            Green  = green;

            CommentNodes = new SafeLazyObjectCollection <PgnTriviaElementSyntax>(
                green.CommentNodes.Count,
                index => new PgnTriviaElementSyntax(this, index, Green.CommentNodes[index]));

            backgroundAfter = new SafeLazyObject <PgnBackgroundListSyntax>(() => new PgnBackgroundListSyntax(this, Green.BackgroundAfter));
        }
Пример #3
0
 internal WithTriviaSyntax(GreenPgnTriviaSyntax greenLeadingTrivia)
 {
     leadingTrivia = new SafeLazyObject <PgnTriviaSyntax>(() => new PgnTriviaSyntax(this, greenLeadingTrivia));
 }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of <see cref="GreenWithTriviaSyntax"/>.
 /// </summary>
 /// <param name="leadingTrivia">
 /// The leading trivia of the syntax node.
 /// </param>
 /// <param name="contentNode">
 /// The content syntax node which anchors the trivia.
 /// </param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="leadingTrivia"/> and/or <paramref name="contentNode"/> are null.
 /// </exception>
 public GreenWithTriviaSyntax(GreenPgnTriviaSyntax leadingTrivia, IGreenPgnSymbol contentNode)
 {
     LeadingTrivia = leadingTrivia ?? throw new ArgumentNullException(nameof(leadingTrivia));
     ContentNode   = contentNode ?? throw new ArgumentNullException(nameof(contentNode));
 }