Class MidStatementNode
- Namespace
- RDCore.SDK.Model.AST.Statements
- Assembly
- RDCore.SDK.dll
MS-VBAL §5.4.3.5 Mid/MidB/Mid$/MidB$ Statement — replaces a span of characters
(or bytes, in the MidB/MidB$ forms) within Target, starting at the
1-based position Start, with characters from Value.
public record MidStatementNode : StatementNode, IEquatable<SyntaxNode>, IExecutableNode, IEquatable<StatementNode>, IEquatable<MidStatementNode>
- Inheritance
-
MidStatementNode
- Implements
- Inherited Members
Remarks
IsByteMode and IsStringInput are independent: all four spellings
(Mid, Mid$, MidB, MidB$) are distinct combinations of the two. The
runtime replacement mechanics MS-VBAL §5.4.3.5 spells out only ever split on byte vs. character
indexing (Mid/Mid$ together vs. MidB/MidB$ together) — but the trailing
$ still has to survive into the AST, because it mirrors the same intrinsic-family split as
the Mid/Mid$ function overloads (Function Mid(String As Variant, ...) As
Variant vs. the String-only $ form): Target/Value coerce
against VBVariant without the suffix and against VBString with it. Dropping the
suffix here would silently collapse two different static-semantics signatures into one.
Constructors
MidStatementNode(SyntaxNodeId, SourceLocation, bool, bool, ExpressionNode, ExpressionNode, ExpressionNode?, ExpressionNode)
MS-VBAL §5.4.3.5 Mid/MidB/Mid$/MidB$ Statement — replaces a span of characters
(or bytes, in the MidB/MidB$ forms) within Target, starting at the
1-based position Start, with characters from Value.
public MidStatementNode(SyntaxNodeId Identity, SourceLocation SourceLocation, bool IsByteMode, bool IsStringInput, ExpressionNode Target, ExpressionNode Start, ExpressionNode? Length, ExpressionNode Value)
Parameters
IdentitySyntaxNodeIdA unique identifier for this specific syntax node.
SourceLocationSourceLocationThe document location (
Uri+Range) of the bound expression.IsByteModebooltrueforMidB/MidB$(byte-indexed);falseforMid/Mid$(character-indexed).IsStringInputbooltruewhen the mode specifier carries the\(</code> suffix (<code>Mid\)/MidB$).TargetExpressionNodeThe
bound-variable-expressionbeing modified in place.StartExpressionNodeThe 1-based position within Target where replacement begins.
LengthExpressionNodeThe maximum number of characters/bytes to replace, or
nullwhen omitted (replaces through the end of Target or Value, whichever is shorter).ValueExpressionNodeThe expression supplying the replacement characters/bytes.
Remarks
IsByteMode and IsStringInput are independent: all four spellings
(Mid, Mid$, MidB, MidB$) are distinct combinations of the two. The
runtime replacement mechanics MS-VBAL §5.4.3.5 spells out only ever split on byte vs. character
indexing (Mid/Mid$ together vs. MidB/MidB$ together) — but the trailing
$ still has to survive into the AST, because it mirrors the same intrinsic-family split as
the Mid/Mid$ function overloads (Function Mid(String As Variant, ...) As
Variant vs. the String-only $ form): Target/Value coerce
against VBVariant without the suffix and against VBString with it. Dropping the
suffix here would silently collapse two different static-semantics signatures into one.
Properties
IsByteMode
true for MidB/MidB$ (byte-indexed); false for Mid/Mid$ (character-indexed).
public bool IsByteMode { get; init; }
Property Value
IsStringInput
true when the mode specifier carries the \(</code> suffix (<code>Mid\)/MidB$).
public bool IsStringInput { get; init; }
Property Value
Length
The maximum number of characters/bytes to replace, or null when omitted (replaces through the end of Target or Value, whichever is shorter).
public ExpressionNode? Length { get; init; }
Property Value
Start
The 1-based position within Target where replacement begins.
public ExpressionNode Start { get; init; }
Property Value
Target
The bound-variable-expression being modified in place.
public ExpressionNode Target { get; init; }
Property Value
Value
The expression supplying the replacement characters/bytes.
public ExpressionNode Value { get; init; }