-
Notifications
You must be signed in to change notification settings - Fork 45
Lean backend [M2] - 3/3 - Resugarings #1591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
46797ea to
d3a7e5d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks OK to me.
The if/else if chain is a pity, we should probably offer a nicer API in the BinOp resugaring.
But let's address that later.
franziskuskiefer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, just a few questions and nits
d3a7e5d to
4ae789c
Compare
4ae789c to
b987d37
Compare
This PR is a follow-up of #1590. It uses the visitors of #1585 to implement resugarings, i.e. passes over the AST that replace certain patterns with special resugared nodes, allowing for a special treatment by the backend.
The Lean extracted code is made much more readable and close to the Rust code. This PR only defines resugaring for some binary arithmetic operations, as a proof of concept.
Example
For instance, the
barrettextracted code goes fromto