Class OnErrorGoToStatementNode
- Namespace
- RDCore.SDK.Model.AST.Statements
- Assembly
- RDCore.SDK.dll
Represents a statement that defines a locally-scoped error handler label (MS-VBAL §5.4.4.1).
public record OnErrorGoToStatementNode : StatementNode, IEquatable<SyntaxNode>, IExecutableNode, IEquatable<StatementNode>, IEquatable<OnErrorGoToStatementNode>
- Inheritance
-
OnErrorGoToStatementNode
- Implements
- Inherited Members
- Extension Methods
Constructors
OnErrorGoToStatementNode(SyntaxNodeId, SourceLocation, ExpressionNode, bool)
Represents a statement that defines a locally-scoped error handler label (MS-VBAL §5.4.4.1).
public OnErrorGoToStatementNode(SyntaxNodeId Identity, SourceLocation SourceLocation, ExpressionNode LabelExpression, bool IsLocal = false)
Parameters
IdentitySyntaxNodeIdA unique identifier for this specific syntax node.
SourceLocationSourceLocationThe document location (
Uri+Range) of the bound expression.LabelExpressionExpressionNodeWhatever expression followed
GoTo— usually a real label, but not always: MS-VBAL §5.4.4.1 carves out the line-number-label0as a sentinel meaning "error handling disabled", not a label to resolve. Real-world VBA also treats-1as a sentinel ("clear the current error, so a laterOn Errorcan re-arm"), though MS-VBAL does not document that form. A future consumer resolving this against the module's labels must special-case both before treating it as a real label reference.IsLocalbooltruewhen the statement is writtenOn Local Error, the archaic form ofOn Error(MS-VBAL §5.4.4.1): every error is local to the procedure it is handled in, so the keyword says nothing, and the two statements are the same.
Properties
IsLocal
true when the statement is written On Local Error, the archaic form of On Error (MS-VBAL §5.4.4.1): every error is local to the
procedure it is handled in, so the keyword says nothing, and the two statements are the same.
public bool IsLocal { get; init; }
Property Value
LabelExpression
Whatever expression followed GoTo — usually a real label, but not always: MS-VBAL §5.4.4.1
carves out the line-number-label 0 as a sentinel meaning "error handling disabled", not a
label to resolve. Real-world VBA also treats -1 as a sentinel ("clear the current error, so a
later On Error can re-arm"), though MS-VBAL does not document that form. A future consumer
resolving this against the module's labels must special-case both before treating it as a real
label reference.
public ExpressionNode LabelExpression { get; init; }