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

feat: support macros 2.0 #235

Closed
wants to merge 1 commit into from
Closed

Conversation

roife
Copy link

@roife roife commented Sep 6, 2024

fix #45

This PR rename the former macro_definition (macro_rules!) to macro_rules, and reuse macro_definition for the new macro syntax.

Tests are copied from the RFC: https://github.com/rust-lang/rfcs/blob/master/text/1584-macros.md.

@amaanq
Copy link
Member

amaanq commented Sep 7, 2024

The syntax is not concretely defined, and it's likely subject to change - we can add it once there is a more proper specification

@amaanq amaanq closed this Sep 7, 2024
@roife
Copy link
Author

roife commented Sep 7, 2024

However, this syntax is already being widely used in rustc (for example in https://github.com/rust-lang/rust/blob/9afe7136958edaa403f0b0eb00f0353c125b7352/compiler/rustc_driver_impl/src/lib.rs). When treesit parses this file, it generates a bunch of errors, causing the entire file to fail to highlight correctly.

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.

Parse new macro declarative expression
2 participants