valkyrie-parser 0.2.5

The hand write parser of valkyrie language
Documentation
macro
ApplyCallNode {
    monadic: false,
    caller: a,
    arguments: [],
    body: None,
    span: 7..105,
}
FunctionDeclaration {
    name: A,
    kind: Macro,
    annotations: Annotation {
        attributes: [
            AttributeTerm {
                kind: Normal,
                path: derive,
                variant: [],
                arguments: [
                    ArgumentTerm {
                        key: Nothing,
                        value: Copy,
                    },
                    ArgumentTerm {
                        key: Nothing,
                        value: Clone,
                    },
                    ArgumentTerm {
                        key: Nothing,
                        value: Debug,
                    },
                    ArgumentTerm {
                        key: Nothing,
                        value: PartialEq,
                    },
                    ArgumentTerm {
                        key: Nothing,
                        value: Eq,
                    },
                    ArgumentTerm {
                        key: Nothing,
                        value: Hash,
                    },
                ],
                domain: None,
                span: 124..172,
            },
        ],
        modifiers: [
            derived,
        ],
    },
    generics: [],
    parameters: [],
    returns: Auto,
    body: [],
}
FunctionDeclaration {
    name: print,
    kind: Macro,
    annotations: Annotation {
        modifiers: [
            implicit,
        ],
    },
    generics: [],
    parameters: [],
    returns: Auto,
    body: [],
}
FunctionDeclaration {
    name: name,
    kind: Micro,
    annotations: Empty,
    generics: [
        Parameter {
            key: "G",
        },
        Parameter {
            key: "R",
        },
    ],
    parameters: [
        Parameter {
            key: "g",
            bound: G,
        },
    ],
    returns: ReturnType {
        main: R,
    },
    body: [
        InfixNode {
            infix: +,
            lhs: 1,
            rhs: 1,
        },
        InfixNode {
            infix: ∈,
            lhs: a,
            rhs: b,
        },
        ApplyCallNode {
            monadic: false,
            caller: print,
            arguments: [
                ArgumentTerm {
                    key: Nothing,
                    value: 'Hello, world!',
                },
            ],
            body: None,
            span: 294..311,
        },
    ],
}
FunctionDeclaration {
    name: outer,
    kind: Macro,
    annotations: Empty,
    generics: [
        Parameter {
            key: "L",
        },
    ],
    parameters: [
        Parameter {
            key: "lhs",
            bound: L,
        },
    ],
    returns: ReturnType {
        main: String,
    },
    body: [
        VariableDeclaration {
            pattern: TuplePatternNode {
                bind: None,
                name: None,
                terms: [],
                span: 0..0,
            },
            body: 0,
            span: 361..384,
        },
    ],
}
FunctionDeclaration {
    name: inner,
    kind: Micro,
    annotations: Empty,
    generics: [
        Parameter {
            key: "R",
        },
    ],
    parameters: [
        Parameter {
            key: "rhs",
            bound: R,
        },
    ],
    returns: Auto,
    body: [
        WhileLoop {
            kind: While,
            condition: Unconditional,
            then: [
                InfixNode {
                    infix: +=,
                    lhs: count,
                    rhs: 1,
                },
                ApplyCallNode {
                    monadic: false,
                    caller: print,
                    arguments: [
                        ArgumentTerm {
                            key: Nothing,
                            value: '{lhs} {rhs}',
                        },
                    ],
                    body: None,
                    span: 473..488,
                },
            ],
            span: 422..499,
        },
        '{count}',
    ],
}
FunctionDeclaration {
    name: main,
    kind: Micro,
    annotations: Annotation {
        modifiers: [
            public,
            static,
            final,
        ],
    },
    generics: [],
    parameters: [
        Parameter {
            key: "args",
            annotations: Annotation {
                modifiers: [
                    mut,
                ],
            },
            bound: GenericCallNode {
                monadic: false,
                base: List,
                term: [
                    ArgumentTerm {
                        key: Nothing,
                        value: String,
                    },
                ],
                span: 557..569,
            },
        },
    ],
    returns: ReturnType {
        main: Int,
    },
    body: [
        ApplyCallNode {
            monadic: false,
            caller: ApplyCallNode {
                monadic: false,
                caller: outer,
                arguments: [
                    ArgumentTerm {
                        key: Nothing,
                        value: 'Hello',
                    },
                ],
                body: None,
                span: 589..598,
            },
            arguments: [
                ArgumentTerm {
                    key: Nothing,
                    value: 'world',
                },
            ],
            body: None,
            span: 598..607,
        },
        Control {
            kind: Return,
            expression: 0,
            span: 612..620,
        },
    ],
}