Table of Contents

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

Before string

The text of the logical line before the position.

After string

The text of the logical line from the position on.

FirstLine int

The first physical line of the logical line, from 0.

LastLine int

The 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

string

Before

The text of the logical line before the position.

public string Before { get; init; }

Property Value

string

FirstLine

The first physical line of the logical line, from 0.

public int FirstLine { get; init; }

Property Value

int

LastLine

The last physical line of the logical line, from 0.

public int LastLine { get; init; }

Property Value

int

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

lines IReadOnlyList<string>

The physical lines of the module; a line may end with the \r of its terminator.

line int

The physical line of the position, from 0.

character int

The position in that line, clamped to it.

Returns

LogicalLine

Exceptions

ArgumentOutOfRangeException

line is not a line of lines.