Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

parser: support paths in bang macro invocations (e.g. path::to::macro!()) #36662

Merged
merged 7 commits into from
Sep 27, 2016

Conversation

jseyfried
Copy link
Contributor

@jseyfried jseyfried commented Sep 22, 2016

Groundwork for macro modularization (cc #35896).
r? @nrc

}

m!(); //~ NOTE the usage of `m!` is likely invalid in item context

Copy link
Contributor Author

@jseyfried jseyfried Sep 22, 2016

Choose a reason for hiding this comment

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

After this PR, this would trigger a parse error when expanded (expected one of !or::``).

@jseyfried
Copy link
Contributor Author

cc @petrochenkov

@jseyfried jseyfried force-pushed the parse_macro_invoc_paths branch 2 times, most recently from 9b1c954 to be28b20 Compare September 23, 2016 01:29
@jseyfried jseyfried force-pushed the parse_macro_invoc_paths branch from be28b20 to 2c85733 Compare September 23, 2016 04:29
@petrochenkov
Copy link
Contributor

Looks good.

Note to myself: audit all places where disambiguation "path vs ident" happens, there are still some inconsistencies.

@nrc
Copy link
Member

nrc commented Sep 26, 2016

Am I right that this PR means path macros can be parsed but will always give an error later on before being expanded? If not, then it'd be good to have a feature gate in here.

Could you add some tests too please?

@jseyfried
Copy link
Contributor Author

jseyfried commented Sep 26, 2016

Yeah, expand_bang_invoc always errors on non-trivial paths.

@jseyfried
Copy link
Contributor Author

Added tests.

@nrc
Copy link
Member

nrc commented Sep 26, 2016

@bors: r+

@bors
Copy link
Collaborator

bors commented Sep 26, 2016

📌 Commit 34f4ad1 has been approved by nrc

sophiajt pushed a commit to sophiajt/rust that referenced this pull request Sep 26, 2016
…r=nrc

parser: support paths in bang macro invocations (e.g. `path::to::macro!()`)

r? @nrc
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Sep 27, 2016
…r=nrc

parser: support paths in bang macro invocations (e.g. `path::to::macro!()`)

r? @nrc
bors added a commit that referenced this pull request Sep 27, 2016
@bors bors merged commit 34f4ad1 into rust-lang:master Sep 27, 2016
@jseyfried jseyfried deleted the parse_macro_invoc_paths branch October 16, 2016 09:31
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants