/// <summary> /// Initializes a new instance of <see cref="GreenPgnTagElementInMoveTreeSyntax"/>. /// </summary> /// <param name="tagElement"> /// The tag element which was ignored in the move tree section. /// </param> /// <exception cref="ArgumentNullException"> /// <paramref name="tagElement"/> is null. /// </exception> /// <exception cref="ArgumentException"> /// <paramref name="tagElement"/> is not a tag element, -or- it is a tag name which should have been converted to an unrecognized move instead. /// </exception> public GreenPgnTagElementInMoveTreeSyntax(IGreenPgnSymbol tagElement) { TagElement = tagElement ?? throw new ArgumentNullException(nameof(tagElement)); if (tagElement.SymbolType < PgnSymbolType.BracketOpen || tagElement.SymbolType > PgnSymbolType.ErrorTagValue || tagElement.SymbolType == PgnSymbolType.TagName) { throw new ArgumentException($"{nameof(tagElement)} has illegal symbol type {tagElement.SymbolType}", nameof(tagElement)); } }
/// <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)); }