Table of Contents

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

Identity SyntaxNodeId

A unique identifier for this specific syntax node.

SourceLocation SourceLocation

The document location (Uri+Range) of the bound expression.

LabelExpression ExpressionNode

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.

IsLocal bool

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.

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

bool

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; }

Property Value

ExpressionNode