Skip to content

Comments

Remove syn dependency#8

Merged
LukasKalbertodt merged 7 commits intomasterfrom
remove-syn
Sep 8, 2020
Merged

Remove syn dependency#8
LukasKalbertodt merged 7 commits intomasterfrom
remove-syn

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

Development

Successfully merging this pull request may close these issues.

Research how to get rid of syn with full feature dependency Add crate feature to enable only using style! (would remove syn dependency)

1 participant