Class VBSyntaxErrorInfo
Encapsulates the serializable error data for a syntax error.
public record VBSyntaxErrorInfo : VBErrorInfo, IEquatable<VBErrorInfo>, IEquatable<VBSyntaxErrorInfo>
- Inheritance
-
VBSyntaxErrorInfo
- Implements
- Inherited Members
Remarks
A syntax error occurs while traversing the concrete syntax tree (CST) in the parser. A single positional constructor keeps the type round-trippable through System.Text.Json.
Constructors
VBSyntaxErrorInfo(int, SourceLocation, string, string)
Encapsulates the serializable error data for a syntax error.
public VBSyntaxErrorInfo(int ErrorId, SourceLocation Location, string Description, string Verbose)
Parameters
ErrorIdintThe number of the error: the number of its
VBCdiagnostic code.LocationSourceLocationThe document location of the faulted CST node.
DescriptionstringAn error description. "Syntax error" unless specified otherwise.
VerbosestringA detailed message identifying the faulted CST token and detailing its semantics.
Remarks
A syntax error occurs while traversing the concrete syntax tree (CST) in the parser. A single positional constructor keeps the type round-trippable through System.Text.Json.
Properties
StatementStart
Where the statement the parser was reading when it found the error begins, or null when the error is in no statement: the statement the
error is in, wherever it is reported.
public SourcePosition? StatementStart { get; init; }
Property Value
Remarks
A block that is not closed is reported at the token where its end was expected, often the end of the procedure, and that token can be in another
branch of a #If than the block. The parser reads every branch, and does not know which one is compiled
(MS-VBAL §3.4). The branch the error belongs to is the one this position is in.