Skip to content

Commit 0573e53

Browse files
author
Alexis Hunt
committed
Expand docs on Macros By Example.
The primary motivation here was to increase clarity and fully address the scoping and naming details. The inclusion of RFC 550's formal specification is to move it to the reference where it can be updated. I made several changes, motivated by accommodating `?` and new fragment specifiers, but there are some other things which need highlighting so that they can be double-checked for correctness. * Permit the empty string to follow on in the first invariant; this is a technical oversight in the definition I believe. * Added a requirement that repetitions obey the follow rules; this was an oversight in the original RFC and currently planned for fix. * Rewrote the definition of FIRST for complex NTs to be more clear. * Added a case to LAST for `?` repetitions * Removed the last example of LAST, because it is wrong. * Rearranged the definition of FOLLOW to be more clear * Added Shl to FOLLOW(ty) and FOLLOW(path), as documented in the Reference already. * Added missing follow sets for newer fragment specifiers. The scoping text is probably not completely accurate, but it's certainly much better than what was there before (i.e. basically nothing).
1 parent dafc0ba commit 0573e53

5 files changed

+779
-123
lines changed

src/SUMMARY.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@
111111

112112
- [Constant Evaluation](const_eval.md)
113113

114-
[Appendix: Influences](influences.md)
115-
116-
[Appendix: As-yet-undocumented Features](undocumented.md)
117-
118-
[Appendix: Glossary](glossary.md)
114+
- [Appendices](appendices.md)
115+
- [Macro Follow-Set Ambiguity Formal Specification](macro-ambiguity.md)
116+
- [Influences](influences.md)
117+
- [As-Yet-Undocumented Features](undocumented.md)
118+
- [Glossary](glossary.md)

src/appendices.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Appendices

src/attributes.md

-2
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,6 @@ which can be used to control type layout.
175175
macros named. The `extern crate` must appear at the crate root, not inside
176176
`mod`, which ensures proper function of the `$crate` macro variable.
177177

178-
- `macro_reexport` on an `extern crate` — re-export the named macros.
179-
180178
- `macro_export` - export a `macro_rules` macro for cross-crate usage.
181179

182180
- `no_link` on an `extern crate` — even if we load this crate for macros, don't

0 commit comments

Comments
 (0)