public readonly record struct SyntaxTriviaA run of insignificant text — whitespace, a line break, a comment — carried on the leading or trailing edge of a SyntaxToken.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
A value rather than a node, because trivia occupies no slot: it hangs off a token, which is what keeps ChildNodesAndTokens seeing tokens as leaves. It is public for the things that have to look at what the parser threw away — a syntax highlighter colouring comments, a formatter deciding where a blank line went, a doc-comment reader.
Fields and properties (4)
public int RawKindThe trivia's kind in the owning language's vocabulary, as an integer for the same reason RawKind is.
public string TextThe exact source text.
public int PositionAbsolute position of the first character.
public TextSpan SpanThe trivia's span in the source.
Methods (2)
public SyntaxTrivia(int RawKind, string Text, int Position)A run of insignificant text — whitespace, a line break, a comment — carried on the leading or trailing edge of a SyntaxToken.
public override string ToString()The trivia's text, so a trivia prints as what it is.
Used by (3)
- NavigationTestsVixen.Core.Syntax.Tests
- SyntaxTokenVixen.Core.Syntax
- SyntaxNavigationTestsVixen.Raven.Tests