Skip to main content

NodeKind

Enum NodeKind 

Source
pub enum NodeKind {
Show 69 variants Root, EnumDeclaration, TypeAlias, EnumDefinition, EnumCases, EnumCase, EnumConstructor, TypeInstConcatenation, Declaration, FunctionDeclaration, PredicateDeclaration, AnnotationCapture, TestDeclaration, AnnotationDeclaration, ParameterList, Parameter, TypeInstVariable, ScalarType, TupleType, RecordType, RecordField, TupleLiteral, RecordLiteral, RecordLiteralField, FieldAccessExpression, DomainType, SetType, SetCardinality, ArrayType, ArrayIndexBinding, ListType, Assignment, Constraint, Include, Output, Solve, SolveMinimize, SolveMaximize, Expression, InterpolatedString, UnaryExpression, BinaryExpression, ParenthesizedExpression, CallExpression, GeneratorCallExpression, ConditionalExpression, ConditionalBranch, ElseBranch, LetExpression, LetBlock, SetComprehension, ArrayComprehension, IndexedArrayComprehension, GeneratorList, Generator, WhereFilter, SetLiteral, ArrayLiteral, IndexedArrayEntry, IndexTuple, MatrixLiteral, MatrixColumnIndices, MatrixRow, ArrayAccessExpression, NamedArgument, AnnotatedExpression, Annotation, RangeExpression, Error,
}

Variants§

§

Root

§

EnumDeclaration

Direct name token, annotations, and an optional EnumDefinition child.

§

TypeAlias

Direct name token, annotations, and the target type child.

§

EnumDefinition

Ordered case lists and constructors, separated by written ++ tokens.

§

EnumCases

Braces containing EnumCase children in written order.

§

EnumCase

The direct identifier token declares an enum member.

§

EnumConstructor

A direct declaration name (or anonymous _) and a parenthesized expression.

§

TypeInstConcatenation

Left type and right base type, separated by a written ++ token.

§

Declaration

The first child node is the type; later nodes are annotations/initializer.

§

FunctionDeclaration

Return type child, direct name token, and optional parameter list, annotations and body expression. Deprecated omitted-keyword declarations contain no function token.

§

PredicateDeclaration

Direct name token, optional parameter list, annotation capture, annotations and body.

§

AnnotationCapture

Written ann, colon and direct binding name; captures contextual annotations in a predicate signature, separate from its formal ParameterList.

§

TestDeclaration

Direct name token, optional parameter list, annotations and body.

§

AnnotationDeclaration

Direct name token, optional parameter list and body; no annotations.

§

ParameterList

Parentheses and ordered Parameter children; omitted lists have no node.

§

Parameter

The type child, optional direct name token, ordered Annotation children, and optional default expression child. Unnamed parameters contain only a type; annotations after a default belong to that expression.

§

TypeInstVariable

Generic variable spelling, with any/var/par/opt qualifiers retained.

§

ScalarType

§

TupleType

Ordered type children within written tuple parentheses.

§

RecordType

Ordered RecordField children within written record parentheses.

§

RecordField

Type child and direct declaration name token with its precise range.

§

TupleLiteral

Parentheses and ordered value children; the first comma is required.

§

RecordLiteral

Ordered RecordLiteralField children; the first comma is required.

§

RecordLiteralField

Direct field name token and value child; names label values, not declarations.

§

FieldAccessExpression

Subject child followed by a dot and direct reference name or integer token.

§

DomainType

Contains one domain expression, with any qualifiers retained as tokens.

§

SetType

Contains an optional cardinality followed by the element type. Qualifiers and set of remain tokens.

§

SetCardinality

Parentheses containing the written cardinality expression.

§

ArrayType

Child nodes are index types or bindings followed by the element type.

§

ArrayIndexBinding

Direct tokens retain the binding name and in; the child is its index type.

§

ListType

Contains the element type.

§

Assignment

§

Constraint

A keyword/optional label and expression, or a keyword-free identifier equality.

§

Include

Contains the written string literal path; no include resolution is performed.

§

Output

Optional direct Annotation child followed by the output expression.

§

Solve

A satisfy item, with direct Annotation children and no objective.

§

SolveMinimize

Direct Annotation children followed by the minimization objective expression.

§

SolveMaximize

Direct Annotation children followed by the maximization objective expression.

§

Expression

A literal or identifier atom, including anonymous and absent values.

§

InterpolatedString

Exact string chunks alternate with embedded expression child nodes.

§

UnaryExpression

§

BinaryExpression

§

ParenthesizedExpression

§

CallExpression

A callable invocation or anonymous _(expression) enum constructor.

§

GeneratorCallExpression

Written call name/header tokens, an ordered generator list, then a parenthesized body expression.

§

ConditionalExpression

Ordered if/elseif branches, an optional else branch, and the endif token.

§

ConditionalBranch

The keyword, condition expression, then token, and body expression.

§

ElseBranch

The else token and its body expression.

§

LetExpression

The let token, local block, in token, and greedy body expression.

§

LetBlock

Ordered Declaration/Constraint children with written separators. Local declarations expose names and their ranges as direct token leaves, just like top-level declarations; the first child node is their type.

§

SetComprehension

Child nodes are the head expression and ordered generator list.

§

ArrayComprehension

§

IndexedArrayComprehension

Child nodes are an indexed entry (key/value) and ordered generator list.

§

GeneratorList

Child nodes are generators in written order; commas remain token leaves.

§

Generator

Direct tokens retain binding names and in or =. Child nodes are the source/value expression followed by an optional attached WhereFilter.

§

WhereFilter

The written where token followed by its expression child.

§

SetLiteral

Child nodes are the entries; empty literals have no child nodes.

§

ArrayLiteral

Child nodes are bare expressions or indexed entries, in written order.

§

IndexedArrayEntry

Child nodes are the written key and value, separated by a colon token.

§

IndexTuple

Parenthesized key components; only supported in indexed-entry keys.

§

MatrixLiteral

Contains an optional column header and rows, with written pipe delimiters.

§

MatrixColumnIndices

Child nodes are column indices, each followed by a colon token.

§

MatrixRow

Child nodes are cells, preceded by an index child when a colon is present. Empty written rows have a zero-width range at their pipe delimiter.

§

ArrayAccessExpression

Child nodes are the subject followed by one or more index expressions.

§

NamedArgument

§

AnnotatedExpression

§

Annotation

An annotation marker and its atom; distinct from the annotated subject.

§

RangeExpression

Children contain the written bounds and marker; either bound may be omitted.

§

Error

Trait Implementations§

Source§

impl Clone for NodeKind

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for NodeKind

Source§

impl Debug for NodeKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for NodeKind

Source§

impl PartialEq for NodeKind

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for NodeKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.