Skip to content

bend-n/lower

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lower

lowers expressions to their "desugared" form.

e.g

a * b + c => (a.mul(b)).add(c)

note that it is extremely pervasive, so

lower::math! { fn main() -> u8 {
    const X: u8 = 31 * 2;
    return 2 * X + 2;
} }

expands to

fn main() -> u8 {
    const X: u8 = 31.mul(2);
    return (2.mul(X)).add(2);
}

it should work for most expressions.

why

well, you see, i made a crate for arrays. then, i added add/mul/…, and got annoyed when i had to call them manually. now, you can do amazing things such as lower::math! { 2 * ([5, 2] + 5) }.

About

desugars operator overloading

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages