about summary refs log tree commit diff
path: root/compiler/rustc_expand/src/mbe.rs
AgeCommit message (Collapse)AuthorLines
2023-12-11Add spacing information to delimiters.Nicholas Nethercote-3/+3
This is an extension of the previous commit. It means the output of something like this: ``` stringify!(let a: Vec<u32> = vec![];) ``` goes from this: ``` let a: Vec<u32> = vec![] ; ``` With this PR, it now produces this string: ``` let a: Vec<u32> = vec![]; ```
2022-11-20Move macro_rules diagnostics to diagnostics moduleNilstrieb-0/+1
2022-11-02Add `Tracker` to track matching operationsNilstrieb-1/+1
This should allow us to collect detailed information without slowing down the inital hot path.
2022-05-20Remove `crate` visibility usage in compilerJacob Pratt-6/+6
2022-04-28rustc_ast: Harmonize delimiter naming with `proc_macro::Delimiter`Vadim Petrochenkov-4/+4
2022-04-14`mbe::TokenTree`: remove `Lrc` around `Delimited` and `SequenceRepetition`.Nicholas Nethercote-4/+3
2022-04-14Introduce `TtHandle` and use it in `TokenSet`.Nicholas Nethercote-12/+0
This removes the last use of `<mbe::TokenTree as Clone>`. It also removes two trivial methods on `Delimited`.
2022-04-13`SequenceRepetition` and `Delimited` don't need to be `Clone`.Nicholas Nethercote-2/+2
2022-04-09Remove explicit delimiter token trees from `Delimited`.Nicholas Nethercote-34/+10
They were introduced by the final commit in #95159 and gave a performance win. But since the introduction of `MatcherLoc` they are no longer needed. This commit reverts that change, making the code a bit simpler.
2022-03-30Spellchecking some commentsYuri Astrakhan-1/+1
This PR attempts to clean up some minor spelling mistakes in comments
2022-03-23Eliminate `TokenTreeOrTokenTreeSlice`.Nicholas Nethercote-47/+41
As its name suggests, `TokenTreeOrTokenTreeSlice` is either a single `TokenTree` or a slice of them. It has methods `len` and `get_tt` that let it be treated much like an ordinary slice. The reason it isn't an ordinary slice is that for `TokenTree::Delimited` the open and close delimiters are represented implicitly, and when they are needed they are constructed on the fly with `Delimited::{open,close}_tt`, rather than being present in memory. This commit changes `Delimited` so the open and close delimiters are represented explicitly. As a result, `TokenTreeOrTokenTreeSlice` is no longer needed and `MatcherPos` and `MatcherTtFrame` can just use an ordinary slice. `TokenTree::{len,get_tt}` are also removed, because they were only needed to support `TokenTreeOrTokenTreeSlice`. The change makes the code shorter and a little bit faster on benchmarks that use macro expansion heavily, partly because `MatcherPos` is a lot smaller (less data to `memcpy`) and partly because ordinary slice operations are faster than `TokenTreeOrTokenTreeSlice::{len,get_tt}`.
2022-03-09Implement macro meta-variable expressionsCaio-6/+10
2021-04-19fix few typosklensy-1/+1
2020-12-22Revert "Promote missing_fragment_specifier to hard error"Wesley Wiser-1/+1
This reverts commit 02eae432e7476a0686633a8c2b7cb1d5aab1bd2c.
2020-10-30Fix some more clippy warningsJoshua Nelson-4/+1
2020-08-30mv compiler to compiler/mark-0/+152