pub enum NodeKind {
Scalar {
name: Ident,
},
Array {
name: Ident,
length: Expression,
},
Matrix {
name: Ident,
rows: Reference,
cols: Reference,
},
Tuple {
elements: Vec<NodeId>,
},
Repeat {
count: Expression,
index_var: Option<Ident>,
body: Vec<NodeId>,
},
Section {
header: Option<NodeId>,
body: Vec<NodeId>,
},
Sequence {
children: Vec<NodeId>,
},
Choice {
tag: Reference,
variants: Vec<(Literal, Vec<NodeId>)>,
},
Hole {
expected_kind: Option<NodeKindHint>,
},
}Expand description
The kind of structure node in a competitive programming problem specification.
Rev.1: Rich variants with embedded data. Type and separator info
moved to ConstraintAST (TypeDecl, RenderHint).
Variants§
Scalar
Single variable: N, M, S, etc.
Array
1D array: A_1 … A_N.
Matrix
2D grid, such as C[i][j] or A_{i,j}.
Tuple
Same-line variable group: (N, M, K), (u_i, v_i).
Repeat
Variable-dependent repetition: M lines, T test cases.
Section
Semantically delimited block: header + body.
Sequence
Ordered root of the entire input.
Choice
Tag-dependent branching (query type variants).
Hole
Unfilled position (first-class hole).
Fields
§
expected_kind: Option<NodeKindHint>Trait Implementations§
impl StructuralPartialEq for NodeKind
Auto Trait Implementations§
impl Freeze for NodeKind
impl RefUnwindSafe for NodeKind
impl Send for NodeKind
impl Sync for NodeKind
impl Unpin for NodeKind
impl UnsafeUnpin for NodeKind
impl UnwindSafe for NodeKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more