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

refactor: break SolInput to its own crate #578

Merged
merged 9 commits into from
Mar 20, 2024
Merged

Conversation

prestwich
Copy link
Member

@prestwich prestwich commented Mar 17, 2024

Motivation

Closes #567

Decompose sol! macro and allow reuse of input across multiple expanders

Solution

  • Move SolInput and related
  • Make an Expander trait

followup #579

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@prestwich prestwich added the enhancement New feature or request label Mar 17, 2024
@prestwich prestwich self-assigned this Mar 17, 2024
@prestwich prestwich changed the title refactor: break SolInputs to its own crate refactor: break SolInput to its own crate Mar 17, 2024
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

I don't have enough context for why this is beneficial, but it sounds reasonable to me

pending @DaniPopes

#[cfg(feature = "json")]
mod json;

extern crate syn_solidity as ast;
Copy link
Member

Choose a reason for hiding this comment

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

move above mods?

@prestwich
Copy link
Member Author

prestwich commented Mar 19, 2024

I don't have enough context for why this is beneficial, but it sounds reasonable to me

incremental progress towards reusing the same input for multiple procmacros. Basically, this would allow us to ingest the input (solidity + #[...] attributes) once, handle re-names and other attributes that modify the input, and then run it through multiple expanders

i.e. We could separate the sol interface macro expansion logic, from the rpc bindings macro expansion logic, and then compose those expanders. Much cleaner macro architecture, long-term.

Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

supportive

@prestwich prestwich merged commit d13ea47 into main Mar 20, 2024
21 checks passed
@prestwich prestwich deleted the prestwich/sol-macro-input branch March 20, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Refactor] Break sol_macro::SolInput into a new crate
3 participants