Vixen
02b45cc4
csharp
public readonly record struct SyntaxTrivia

A 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 RawKind

    The trivia's kind in the owning language's vocabulary, as an integer for the same reason RawKind is.

  • public string Text

    The exact source text.

  • public int Position

    Absolute position of the first character.

  • public TextSpan Span

    The 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