Table of Contents

Class ArrayExpressionNode

Namespace
RDCore.SDK.Model.AST.Expressions
Assembly
RDCore.SDK.dll

The Array keyword, written without a qualifier: Array(<element>, ...), which yields a Variant holding an array of its arguments.

public sealed record ArrayExpressionNode : ExpressionNode, IEquatable<SyntaxNode>, IExecutableNode, IEquatable<ExpressionNode>, IEquatable<ArrayExpressionNode>
Inheritance
ArrayExpressionNode
Implements
Inherited Members

Remarks

The language has two of it. The keyword's array begins at the Option Base of the module that says it - the lower bound of Array(1, 2, 3) is 1 under Option Base 1 - and the member of the library's hidden module, which is what VBA.Array(1, 2, 3) names, always begins at 0. Telling them apart is the syntax's to do, because what decides is whether the name was qualified: this node is the unqualified one. The qualified call stays an IndexExpressionNode on a member access, and resolves to the library's member like any other call of one.

The grammar lets the keyword through as an identifier, so Array(1, 2) reaches the parse listener as an index expression on a name, which the listener recognizes by the token, as it does LBound and UBound (ArrayBoundExpressionNode). Arguments that are named or omitted are not elements, and leave the call an index expression for the rules about calls to say what is wrong with it.

Constructors

ArrayExpressionNode(SyntaxNodeId, SourceLocation, ImmutableArray<ExpressionNode>)

The Array keyword, written without a qualifier: Array(<element>, ...), which yields a Variant holding an array of its arguments.

public ArrayExpressionNode(SyntaxNodeId Identity, SourceLocation Location, ImmutableArray<ExpressionNode> Elements)

Parameters

Identity SyntaxNodeId

A unique identifier for this specific syntax node.

Location SourceLocation

The document location (Uri+Range) of the whole construct.

Elements ImmutableArray<ExpressionNode>

The expressions the elements of the array are given, in order; none for Array().

Remarks

The language has two of it. The keyword's array begins at the Option Base of the module that says it - the lower bound of Array(1, 2, 3) is 1 under Option Base 1 - and the member of the library's hidden module, which is what VBA.Array(1, 2, 3) names, always begins at 0. Telling them apart is the syntax's to do, because what decides is whether the name was qualified: this node is the unqualified one. The qualified call stays an IndexExpressionNode on a member access, and resolves to the library's member like any other call of one.

The grammar lets the keyword through as an identifier, so Array(1, 2) reaches the parse listener as an index expression on a name, which the listener recognizes by the token, as it does LBound and UBound (ArrayBoundExpressionNode). Arguments that are named or omitted are not elements, and leave the call an index expression for the rules about calls to say what is wrong with it.

Properties

Elements

The expressions the elements of the array are given, in order; none for Array().

public ImmutableArray<ExpressionNode> Elements { get; init; }

Property Value

ImmutableArray<ExpressionNode>