# A question about macro parsing

**URL:** <https://internals.rust-lang.org/t/a-question-about-macro-parsing/2719>\
**Category:** compiler\
**Created:** [October 3, 2015, 2:15pm UTC](https://internals.rust-lang.org/t/a-question-about-macro-parsing/2719 "2015-10-03T14:15:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![matklad](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/matklad/32/12266_2.png) [@matklad](https://internals.rust-lang.org/u/matklad)\
**Post date:** [October 3, 2015, 2:15pm UTC](https://internals.rust-lang.org/t/a-question-about-macro-parsing/2719/1 "2015-10-03T14:15:21Z")

</div>

Why is `self.parse_path(NoTypesAllowed)` used to parse macro invocations? Each it is preceded by `self.look_ahead(1, |t| *t == token::Not)`, effectivelly enforcing than it is a plain ident.

I’m trying to understand what different kinds of paths are used for, and it is a bit confusing 😄

One more thing adds to confusion: only two variants of `PathParsingMode` are actually used for `parse_qualified_path`, and (modulo parsing idents as macros) only two other variants are used for `parse_path`.

---

<div class="post-metadata">

**Author:** ![paul\_stansifer](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/paul_stansifer/32/660_2.png) [@paul\_stansifer](https://internals.rust-lang.org/u/paul_stansifer)\
**Post date:** [October 8, 2015, 2:39pm UTC](https://internals.rust-lang.org/t/a-question-about-macro-parsing/2719/2 "2015-10-08T14:39:38Z")

</div>

I probably wrote that, but my memories are vague. I suspect that my thinking was that, in the future, it would be nice to be able to invoke macros like `path::to::my::macro!()`, but I needed some way to enforce that, for now, macro invocations were just a single identifier. That may not be a good justification for the code being the way it is!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/system/32/14092_2.png) [@system](https://internals.rust-lang.org/u/system)\
**Post date:** [March 25, 2019, 8:25am UTC](https://internals.rust-lang.org/t/a-question-about-macro-parsing/2719/3 "2019-03-25T08:25:15Z")

</div>

Closed on March 25, 2019, 8:25am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
