cp-ast-core 0.1.3

Core AST types for competitive programming problem specification DSL
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use super::node_id::NodeId;
use super::types::Ident;

/// Reference to a variable or indexed element.
#[derive(Debug, Clone, PartialEq)]
pub enum Reference {
    /// Direct reference to a variable node.
    VariableRef(NodeId),
    /// Indexed reference, such as `A[i]` or `C[i][j]`.
    IndexedRef { target: NodeId, indices: Vec<Ident> },
    /// Unresolved reference (name only, used during construction).
    Unresolved(Ident),
}