Beispiel #1
0
 /// <summary>
 /// Writes the full text of this trivia to the specified TextWriter.
 /// </summary>
 public void WriteTo(System.IO.TextWriter writer)
 {
     UnderlyingNode?.WriteTo(writer);
 }
Beispiel #2
0
 /// <summary>
 /// Determines if this trivia is equivalent to the specified trivia.
 /// </summary>
 public bool IsEquivalentTo(SyntaxTrivia trivia)
 {
     return
         ((UnderlyingNode == null && trivia.UnderlyingNode == null) ||
          (UnderlyingNode != null && trivia.UnderlyingNode != null && UnderlyingNode.IsEquivalentTo(trivia.UnderlyingNode)));
 }
Beispiel #3
0
 /// <summary>
 /// Returns the string representation of this trivia. If this trivia is structured trivia then the returned string
 /// will not include any leading or trailing trivia present on the StructuredTriviaSyntax node of this trivia.
 /// </summary>
 /// <returns>The string representation of this trivia.</returns>
 /// <remarks>The length of the returned string is always the same as Span.Length</remarks>
 public override string ToString()
 {
     return(UnderlyingNode != null?UnderlyingNode.ToString() : string.Empty);
 }
Beispiel #4
0
 /// <summary>
 /// Returns the full string representation of this trivia. If this trivia is structured trivia then the returned string will
 /// include any leading or trailing trivia present on the StructuredTriviaSyntax node of this trivia.
 /// </summary>
 /// <returns>The full string representation of this trivia.</returns>
 /// <remarks>The length of the returned string is always the same as FullSpan.Length</remarks>
 public string ToFullString()
 {
     return(UnderlyingNode != null?UnderlyingNode.ToFullString() : string.Empty);
 }
Beispiel #5
0
 /// <summary>
 /// Returns the child non-terminal node representing the syntax tree structure under this structured trivia.
 /// </summary>
 /// <returns>The child non-terminal node representing the syntax tree structure under this structured
 /// trivia.</returns>
 public SyntaxNode GetStructure()
 {
     return(HasStructure ? UnderlyingNode.GetStructure(this) : null);
 }
Beispiel #6
0
 /// <summary>
 /// Get all the annotations of the specified annotation kinds.
 /// </summary>
 public IEnumerable <SyntaxAnnotation> GetAnnotations(params string[] annotationKinds)
 {
     return(UnderlyingNode != null
         ? UnderlyingNode.GetAnnotations(annotationKinds)
         : SpecializedCollections.EmptyEnumerable <SyntaxAnnotation>());
 }
Beispiel #7
0
 /// <summary>
 /// Determines whether this trivia has the specific annotation.
 /// </summary>
 public bool HasAnnotation(SyntaxAnnotation annotation)
 {
     return(UnderlyingNode?.HasAnnotation(annotation) ?? false);
 }
Beispiel #8
0
 /// <summary>
 /// Determines where this trivia has any annotations of the specified annotation kinds.
 /// </summary>
 public bool HasAnnotations(params string[] annotationKinds)
 {
     return(UnderlyingNode?.HasAnnotations(annotationKinds) ?? false);
 }
Beispiel #9
0
 /// <summary>
 /// Determines where this trivia has annotations of the specified annotation kind.
 /// </summary>
 public bool HasAnnotations(string annotationKind)
 {
     return(UnderlyingNode?.HasAnnotations(annotationKind) ?? false);
 }