Path: redb-route/redb.Route/Expressions/Ast/IndexAccessNode.cs
Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route
Page: https://redbase.app/src/dev-2026-12-06/redb-route/redb.Route/Expressions/Ast/IndexAccessNode.cs
----
using redb.Route.Abstractions;
namespace redb.Route.Expressions.Ast;
///
/// AST node representing index access on a collection/array (e.g. items[0]).
///
public class IndexAccessNode : AstNode
{
///
/// Gets the AST node representing the object being indexed.
///
public AstNode Object { get; }
///
/// Gets the AST node representing the index expression.
///
public AstNode Index { get; }
///
/// Initializes a new instance of the class.
///
/// The object node being indexed.
/// The index expression node.
public IndexAccessNode(AstNode obj, AstNode index)
{
Object = obj;
Index = index;
}
///
public override string ToString() => $"{Object}[{Index}]";
}