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

Remove syn dependency #8

Merged
merged 7 commits into from
Sep 8, 2020
Merged

Remove syn dependency #8

merged 7 commits into from
Sep 8, 2020

Conversation

LukasKalbertodt
Copy link
Owner

Fixes #3
Fixes #4

See commit messages for more information.

- The large `macros/lib.rs` was split into multiple smaller files
- To avoid relying on parsing `syn::Expr`, there are declarative macros
  in `bunt` which slightly process the macro input and delegate it to
  the proc macros. In particular, all expressions are wrapped into
  groups, making it easy to skip in the proc macro parser.
- There are not `print[ln]` proc macros anymore as these convenience
  macros can easily be implemented as decl macros in `bunt`.

Despite this huge diff, lots of code stayed the same and was just
moved somewhere.
This is only possible thanks to the refactor work in the previous
commits.
@LukasKalbertodt
Copy link
Owner Author

Interesting: these changes accidentally require a rustc patch released with 1.46.0. From the changelog:

Tokens passed to macro_rules! are now always captured. This helps ensure that spans have the correct information, and may cause breakage if you were relying on receiving spans with dummy information.

This is required as we know call the proc macros from decl macros. This requirement is also the reason for why CI fails: the GitHub runner still runs on 1.45.2. The runners should be updated weekly, however, so I will just wait a bit.

@LukasKalbertodt LukasKalbertodt merged commit 59cf487 into master Sep 8, 2020
@LukasKalbertodt LukasKalbertodt deleted the remove-syn branch September 8, 2020 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant