name: parser-tree description: Parse Reussir source code into a parser tree. license: MPL-2.0
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)))
}
}
}
}
chat Comments (0)
Sign in to join the discussion and leave a comment.
Skill Details
GitHub Stars
16
GitHub Forks
3
Created
Mar 2026
Last Updated
3 months ago
tools
tools ide plugins
Related Skills
Build your own?
Join 12,000+ developers contributing to the Claude ecosystem.
No comments yet. Be the first to share your thoughts!