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: sol! AST and macro expansion #61

Merged
merged 1 commit into from
Jun 3, 2023
Merged

Conversation

DaniPopes
Copy link
Member

@DaniPopes DaniPopes commented Jun 3, 2023

Decouple expansion logic from the AST.

  • ast
    • item (previous input)
      • Struct
      • Error
      • ...
    • everything else
  • expand
    • previous ToTokens implementations, but as separate functions

Additionally, refactor attributes parsing into doing the same as syn (parse attributes before parsing an Item, then append them into the item's).
Input -> SingleInput -> InputKind becomes File -> Item.

@DaniPopes DaniPopes changed the title refactor: sol macro refactor: sol! AST and macro expansion Jun 3, 2023
@DaniPopes DaniPopes marked this pull request as ready for review June 3, 2023 18:25
@DaniPopes DaniPopes requested a review from prestwich June 3, 2023 18:25
Copy link
Member

@prestwich prestwich left a comment

Choose a reason for hiding this comment

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

let's take this opportunity to document our parser's relationship to the grammar, for future reference

@prestwich
Copy link
Member

also to consider:

  • do we intend this to grow into a full solidity parser ever?
  • should the AST be in a separate crate?

@DaniPopes
Copy link
Member Author

Probably yes, in the future, same for the traits. Would be too much for this PR and we don't need it yet

@DaniPopes DaniPopes force-pushed the dani/refactor-sol branch 2 times, most recently from e201d3a to 23c38df Compare June 3, 2023 20:42
@prestwich
Copy link
Member

Probably yes, in the future, same for the traits. Would be too much for this PR and we don't need it yet

let's open an issue for it :)

@DaniPopes DaniPopes merged commit ee5e4d4 into main Jun 3, 2023
@DaniPopes DaniPopes deleted the dani/refactor-sol branch June 3, 2023 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants