Commit b7838ba
committed
Improve description of
I am initially coming to work on this due to the line
> an IDENTIFIER_OR_KEYWORD except _, RAW_IDENTIFIER, or $crate
being unfortunately very ambiguous, since this can be read
as “_, RAW_IDENTIFIER, or $crate” all belonging
to the “except” listing.
My best fix for that is to add parentheses around the “except _”.
This seems to read more nicely than alternatives I have tried, for instance
> either an IDENTIFIER_OR_KEYWORD except _, or a RAW_IDENTIFIER, or "$crate"
(which still seems ambiguous)
And the exception for “_” seems minor enough (previously it had been missing completely
for a while) that parentheses also seem sensible semantically, IMHO.
The meaning of accepting `$crate` was confusing to me though; and apparently
a known issue, so this closes #588.
To achieve this, I have written a new section to the reference description of `$crate`,
and worded the concept as `$crate` being "initially replaced". The verb "replace"
is for consistency with the wording of other metavariables, which are being "replaced"
during expansion; the qualifier "initially" is added to emphasize the important
difference of this process from *macro expansion*. And also where I'm linking to it,
the phrasing "replaced $crate" can easily be misunderstood for people to think
that "$crate" has already been replaced by the name of the crate it's referring to,
even though that's not at all how this process works!ident fragment matcher1 parent 7446bf9 commit b7838ba
1 file changed
Lines changed: 46 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| |||
664 | 664 | | |
665 | 665 | | |
666 | 666 | | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
667 | 709 | | |
668 | 710 | | |
669 | 711 | | |
| |||
676 | 718 | | |
677 | 719 | | |
678 | 720 | | |
| 721 | + | |
| 722 | + | |
679 | 723 | | |
680 | 724 | | |
681 | 725 | | |
| |||
726 | 770 | | |
727 | 771 | | |
728 | 772 | | |
| 773 | + | |
729 | 774 | | |
730 | 775 | | |
731 | 776 | | |
| |||
0 commit comments