Conversation
The introduction in README.md was updated to provide a more hands-on and interactive description of the tutorial, highlighting both declarative and procedural macros.
Add a detailed overview of procedural macros, including their security considerations and the technical constraints of proc-macro crates. Introduce the core ecosystem tools (syn, quote, proc-macro2) and outline the learning path for this chapter.
- Create token_stream.md with an interactive example. - Create proc_macro2_syn_quote.md to introduce the tool ecosystem. - Update SUMMARY.md to include these new sections.
Expand on the roles of `proc-macro2`, `syn`, and `quote` crates in `proc_macro2_syn_quote.md`. Add a practical code example for parsing `TokenStream` into a syntax tree. Correct the terminology in `token_stream.md` from "AST" to the more accurate "TokenTree".
Add a dedicated chapter for Syntax Trees in procedural macros. This includes: - Moving basic syntax tree examples to a new file. - Adding details on parsing tokens, keywords, and standard syn nodes. - Demonstrating custom parsing via closures and the Parse trait. - Updating SUMMARY.md to link the new section.
Add a new chapter to the tutorial explaining Spans in Rust procedural macros. Includes examples comparing coarse-grained spans from `quote!` with precise spans from `TokenStream::from_str`. - Create src/procedural_macros/span.md - Update src/SUMMARY.md to include the new section
- Include a new chapter explaining the quote crate and its syntax. - Add comparisons between macro_rules! and quote!. - Update SUMMARY.md and cross-reference from token_stream.md.
Marked multiple rust code blocks in procedural macro chapters with `compile_fail` to prevent mdbook/rustdoc from failing during tests. These snippets often require a proc-macro environment or specific dependencies that are not available in the doc-test context.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.