Class LogicalLine
- Namespace
- RDCore.SDK.Model.Symbols.Completion
- Assembly
- RDCore.SDK.dll
The logical line a position of a module is in (MS-VBAL §3.2.2): its physical lines joined where a line continuation ends one, cut at the position.
public sealed record LogicalLine : IEquatable<LogicalLine>
- Inheritance
-
LogicalLine
- Implements
- Inherited Members
Remarks
A line continuation is a _ after a space or a tab at the end of a physical line. It and the line terminator after it read as one space, so a
statement written on several physical lines reads as written on one.
The parser's lexer takes less whitespace before the _ than MS-VBAL §3.2.2 allows: the specification's WSC also
includes the U+0019 character, the ideographic space U+3000 and the other spaces of Unicode class Zs, which the lexer does not take
before a line continuation. Physical lines the parser reads as two logical lines are two here too.
What a completion list and a signature help read of the call being written (CompletionSite, SignatureSite) is read off the logical line: an argument written on the next physical line is still one of the call, and a named argument written there is still given.
Constructors
LogicalLine(string, string, int, int)
The logical line a position of a module is in (MS-VBAL §3.2.2): its physical lines joined where a line continuation ends one, cut at the position.
public LogicalLine(string Before, string After, int FirstLine, int LastLine)
Parameters
BeforestringThe text of the logical line before the position.
AfterstringThe text of the logical line from the position on.
FirstLineintThe first physical line of the logical line, from 0.
LastLineintThe last physical line of the logical line, from 0.
Remarks
A line continuation is a _ after a space or a tab at the end of a physical line. It and the line terminator after it read as one space, so a
statement written on several physical lines reads as written on one.
The parser's lexer takes less whitespace before the _ than MS-VBAL §3.2.2 allows: the specification's WSC also
includes the U+0019 character, the ideographic space U+3000 and the other spaces of Unicode class Zs, which the lexer does not take
before a line continuation. Physical lines the parser reads as two logical lines are two here too.
What a completion list and a signature help read of the call being written (CompletionSite, SignatureSite) is read off the logical line: an argument written on the next physical line is still one of the call, and a named argument written there is still given.
Properties
After
The text of the logical line from the position on.
public string After { get; init; }
Property Value
Before
The text of the logical line before the position.
public string Before { get; init; }
Property Value
FirstLine
The first physical line of the logical line, from 0.
public int FirstLine { get; init; }
Property Value
LastLine
The last physical line of the logical line, from 0.
public int LastLine { get; init; }
Property Value
Methods
At(IReadOnlyList<string>, int, int)
The logical line that physical line line is part of, cut at character.
public static LogicalLine At(IReadOnlyList<string> lines, int line, int character)
Parameters
linesIReadOnlyList<string>The physical lines of the module; a line may end with the
\rof its terminator.lineintThe physical line of the position, from 0.
characterintThe position in that line, clamped to it.
Returns
Exceptions
- ArgumentOutOfRangeException
lineis not a line oflines.