valkyrie-parser 0.2.5

The hand write parser of valkyrie language
Documentation
type
GenericCallNode {
    monadic: false,
    base: InfixNode {
        infix: =,
        lhs: GenericCallNode {
            monadic: false,
            base: Result,
            term: [
                ArgumentTerm {
                    key: Nothing,
                    value: T,
                },
            ],
            span: 11..19,
        },
        rhs: std∷result∷Result,
    },
    term: [
        ArgumentTerm {
            key: Nothing,
            value: T,
        },
        ArgumentTerm {
            key: Nothing,
            value: Error,
        },
    ],
    span: 40..54,
}
type
ApplyCallNode {
    monadic: false,
    caller: GenericCallNode {
        monadic: false,
        base: List,
        term: [
            ArgumentTerm {
                key: Nothing,
                value: UnaryNode {
                    prefix: +,
                    base: T,
                },
            },
            ArgumentTerm {
                key: Nothing,
                value: UnaryNode {
                    prefix: -,
                    base: A,
                },
            },
        ],
        span: 68..81,
    },
    arguments: [],
    body: None,
    span: 81..85,
}
alias
InfixNode {
    infix: =,
    lhs: InfixNode {
        infix: ∈,
        lhs: type,
        rhs: t,
    },
    rhs: Integer,
}
DefineClass {
    name: Integer,
    terms: [
        DomainDeclaration {
            annotations: Empty,
            body: [],
            span: 148..246,
        },
    ],
    span: 115..251,
}
FunctionDeclaration {
    name: five,
    kind: Micro,
    annotations: Empty,
    generics: [],
    parameters: [],
    returns: ReturnType {
        main: i32,
    },
    body: [
        5,
    ],
}
FunctionDeclaration {
    name: tuple,
    kind: Micro,
    annotations: Annotation {
        attributes: [
            AttributeTerm {
                kind: Normal,
                path: ensures,
                variant: [],
                arguments: [
                    ArgumentTerm {
                        key: Nothing,
                        value: InfixNode {
                            infix: ==,
                            lhs: DotCallNode {
                                monadic: false,
                                base: InfixNode {
                                    infix: ∧,
                                    lhs: DotCallNode {
                                        monadic: false,
                                        base: InfixNode {
                                            infix: ==,
                                            lhs: InfixNode {
                                                infix: /,
                                                lhs: DotCallNode {
                                                    monadic: false,
                                                    base: result,
                                                    term: MetaType,
                                                    span: 299..301,
                                                },
                                                rhs: 2,
                                            },
                                            rhs: result,
                                        },
                                        term: 1,
                                        span: 315..317,
                                    },
                                    rhs: result,
                                },
                                term: 2,
                                span: 327..329,
                            },
                            rhs: 'a',
                        },
                    },
                ],
                domain: None,
                span: 285..337,
            },
        ],
    },
    generics: [],
    parameters: [],
    returns: ReturnType {
        main: Tuple {
            terms: [
                ArgumentTerm {
                    key: Nothing,
                    value: i32,
                },
                ArgumentTerm {
                    key: Nothing,
                    value: i32,
                },
                ArgumentTerm {
                    key: Nothing,
                    value: char,
                },
            ],
        },
    },
    body: [
        Tuple {
            terms: [
                ArgumentTerm {
                    key: Nothing,
                    value: 10,
                },
                ArgumentTerm {
                    key: Nothing,
                    value: 5,
                },
                ArgumentTerm {
                    key: Nothing,
                    value: 'a',
                },
            ],
        },
    ],
}
FunctionDeclaration {
    name: all_zeroes,
    kind: Micro,
    annotations: Annotation {
        modifiers: [
            predicate,
        ],
    },
    generics: [],
    parameters: [
        Parameter {
            key: "a",
            bound: UnaryNode {
                prefix: &,
                base: MyArray,
            },
        },
    ],
    returns: ReturnType {
        main: bool,
    },
    body: [
        ApplyCallNode {
            monadic: false,
            caller: forall,
            arguments: [
                ArgumentTerm {
                    key: Nothing,
                    value: LambdaNode {
                        annotations: Empty,
                        generics: [],
                        parameters: [
                            Parameter {
                                key: "i",
                                bound: usize,
                            },
                        ],
                        returns: Auto,
                        body: [
                            InfixNode {
                                infix: ==,
                                lhs: ApplyCallNode {
                                    monadic: false,
                                    caller: DotCallNode {
                                        monadic: false,
                                        base: InfixNode {
                                            infix: ∧,
                                            lhs: ApplyCallNode {
                                                monadic: false,
                                                caller: DotCallNode {
                                                    monadic: false,
                                                    base: InfixNode {
                                                        infix: ∧,
                                                        lhs: InfixNode {
                                                            infix: ⩽,
                                                            lhs: 0,
                                                            rhs: i,
                                                        },
                                                        rhs: InfixNode {
                                                            infix: <,
                                                            lhs: i,
                                                            rhs: a,
                                                        },
                                                    },
                                                    term: len,
                                                    span: 503..507,
                                                },
                                                arguments: [],
                                                body: None,
                                                span: 507..509,
                                            },
                                            rhs: a,
                                        },
                                        term: lookup,
                                        span: 514..521,
                                    },
                                    arguments: [
                                        ArgumentTerm {
                                            key: Nothing,
                                            value: i,
                                        },
                                    ],
                                    body: None,
                                    span: 521..524,
                                },
                                rhs: 0,
                            },
                        ],
                        span: 461..535,
                    },
                },
            ],
            body: None,
            span: 460..536,
        },
    ],
}