Skip to main content

CstConstructError

Type Alias CstConstructError 

Source
pub type CstConstructError<E = Infallible> = ViewConstructionError<TerminalKind, NonTerminalKind, E>;

Aliased Type§

pub enum CstConstructError<E = Infallible> {
    UnexpectedNode {
        node: CstNodeId,
        data: CstNodeData<TerminalKind, NonTerminalKind>,
        expected_kind: NodeKind<TerminalKind, NonTerminalKind>,
    },
    UnexpectedExtraNode {
        node: CstNodeId,
    },
    UnexpectedEndOfChildren {
        parent: CstNodeId,
    },
    UnexpectedEmptyChildren {
        node: CstNodeId,
    },
    NodeIdNotFound {
        node: CstNodeId,
    },
    Error(E),
}

Variants§

§

UnexpectedNode

Expected a specific kind of terminal node, but got an invalid node

Fields

§node: CstNodeId

The index of the node.

§data: CstNodeData<TerminalKind, NonTerminalKind>

The data of the node.

§expected_kind: NodeKind<TerminalKind, NonTerminalKind>

The expected kind.

§

UnexpectedExtraNode

Expected an extra node, but got an invalid node

Fields

§node: CstNodeId

The index of the node.

§

UnexpectedEndOfChildren

Unexpected end of children

Fields

§parent: CstNodeId

The index of the node.

§

UnexpectedEmptyChildren

Unexpected empty children for a non-terminal

Fields

§node: CstNodeId

The index of the node.

§

NodeIdNotFound

The node ID not found in the tree

Fields

§node: CstNodeId

The index of the node.

§

Error(E)

Error that occurs when constructing a view from a NonTerminalHandle.