Skip to content
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

Enable use of macros as macro args #265

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

d1ll0n
Copy link
Sponsor Contributor

@d1ll0n d1ll0n commented Mar 30, 2023

Overview

relies on #264

Allows use of macros as macro args.

This only partially enables this feature as it does not support providing arguments to the macros given as args. I didn't implement this because I believe it would require modification to the parser/lexer, and I don't know rust or this repo well enough to try that. It does at least restore the original functionality from Aztec's version though.

To make this work with bubbled args, I had to modify the resolution order for MacroArg::Ident, as it seemed to be causing a deadlock with the constants mutex. I'm too much of a rust noob to figure that one out, but the change I made seems to have fixed it, maybe because the rust compiler sees that the reference is dropped, or maybe it's a completely different issue unrelated to the mutex.

@d1ll0n d1ll0n requested review from jtriley-eth and removed request for jtriley-eth March 30, 2023 09:27
@d1ll0n d1ll0n added the codegen Code Generation Related. label Mar 30, 2023
jtriley-eth
jtriley-eth previously approved these changes Mar 31, 2023
Copy link
Contributor

@jtriley-eth jtriley-eth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Copy link
Contributor

@jtriley-eth jtriley-eth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes look good, though this should be branched from huff-language:stage, not main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codegen Code Generation Related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants