Class LineContinuationTriviaNode
Preserves a line continuation (MS-VBAL §3.2.2): a blank, an underscore and the end of the line, which make the next line part of the same logical line.
public sealed record LineContinuationTriviaNode : SyntaxNode, IEquatable<SyntaxNode>, IEquatable<LineContinuationTriviaNode>
- Inheritance
-
LineContinuationTriviaNode
- Implements
- Inherited Members
- Extension Methods
Remarks
A line continuation is no code: the logical line is what the parser reads, and no node of the syntax tree stands for where it was broken. It is still source, kept as the module's trivia is, so that a formatter or an exporter can write the module back out as it was read, and a diagnostic can say where it is.
Most continuations stand between two tokens. The one written inside a keyword of two words (End _ then If on the next line) is a part of
that one token, the keyword: Keyword says which.
Constructors
LineContinuationTriviaNode(SyntaxNodeId, SourceLocation, string?)
Preserves a line continuation (MS-VBAL §3.2.2): a blank, an underscore and the end of the line, which make the next line part of the same logical line.
public LineContinuationTriviaNode(SyntaxNodeId Identity, SourceLocation SourceLocation, string? Keyword = null)
Parameters
IdentitySyntaxNodeIdA unique identifier for this specific syntax node.
SourceLocationSourceLocationThe document location (
Uri+Range) of the continuation: the blank before the underscore, the underscore, the blanks after it, the line break, and the blanks that begin the next line.KeywordstringThe keyword of two words the continuation is written inside, its words separated by one space (
End If,Exit Sub); null for a continuation between two tokens.
Remarks
A line continuation is no code: the logical line is what the parser reads, and no node of the syntax tree stands for where it was broken. It is still source, kept as the module's trivia is, so that a formatter or an exporter can write the module back out as it was read, and a diagnostic can say where it is.
Most continuations stand between two tokens. The one written inside a keyword of two words (End _ then If on the next line) is a part of
that one token, the keyword: Keyword says which.
Properties
Keyword
The keyword of two words the continuation is written inside, its words separated by one space (End If, Exit Sub); null
for a continuation between two tokens.
public string? Keyword { get; init; }