parser-tree
Parse Reussir source code into a parser tree.
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill 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)))
}
}
}
}
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-03-11
- Index updated
- 2026-03-11
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!