Rechercher

PythonReactSEOPDF
GitHub Skill

parser-tree

Parse Reussir source code into a parser tree.

reussir-lang☆ 16 Étoiles du dépôt3 Forks du dépôt

Installation

Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.

Voir la source ↗Guides

Instructions

You can use reussir-parser to parse Reussir source code into a parser tree.

For example, cabal run reussir-parser -- tests/integration/frontend/fibonacci.rr will generate the following output:

pub fn fibonacci(n: u64) -> u64 {
    {
        if (n <= 1) then
            {
                n
            }
        else
            {
                (fibonacci((n - 1)) + fibonacci((n - 2)))
            }
    }
}
fn fibonacci_iter_impl(n: u64, acc0: u64, acc1: u64) -> u64 {
    {
        if (n == 0) then
            {
                acc0
            }
        else
            {
                fibonacci_iter_impl((n - 1), acc1, (acc0 + acc1))
            }
    }
}
pub fn fibonacci_iter(n: u64) -> u64 {
    {
        fibonacci_iter_impl(n, 0, 1)
    }
}
fn fibonacci_logarithmic_impl(n: u64, a00: u64, a01: u64, a10: u64, a11: u64, b00: u64, b01: u64, b10: u64, b11: u64) -> u64 {
    {
        if (n == 0) then
            {
                a01
            }
        else
            {
                if ((n % 2) == 1) then
                    {
                        let na00 = ((a00 * b00) + (a01 * b10));
                        let na01 = ((a00 * b01) + (a01 * b11));
                        let na10 = ((a10 * b00) + (a11 * b10));
                        let na11 = ((a10 * b01) + (a11 * b11));
                        fibonacci_logarithmic_impl((n / 2), na00, na01, na10, na11, ((b00 * b00) + (b01 * b10)), ((b00 * b01) + (b01 * b11)), ((b10 * b00) + (b11 * b10)), ((b10 * b01) + (b11 * b11)))
                    }
                else
                    {
                        fibonacci_logarithmic_impl((n / 2), a00, a01, a10, a11, ((b00 * b00) + (b01 * b10)), ((b00 * b01) + (b01 * b11)), ((b10 * b00) + (b11 * b10)), ((b10 * b01) + (b11 * b11)))
                    }
            }
    }
}

Exemples

Consultez les exemples du dépôt source.

Voir la source ↗

Historique source

Date d’indexation
2026-03-11
Mise à jour de l’index
2026-03-11
Branch
main

Les dates concernent ce répertoire. Consultez le dépôt pour l’historique du code.

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!