Commit Graph

31 Commits

Author SHA1 Message Date
Daniel Eades
95d14c393c avoid 'cloning' types that implement 'Copy' 2023-01-10 18:20:12 +00:00
Daniel Eades
4f8ffd0ba4 remove unnecessary lifetimes that can be elided 2023-01-02 15:02:54 +00:00
Daniel Eades
cc80c5bd07 remove unnecessary lazy evaluations 2023-01-02 15:02:54 +00:00
Ryo Yoshida
a7d411425c
mbe: handle multi-character separator 2022-12-28 00:59:56 +09:00
Ryo Yoshida
ec7148b091
mbe: split Op::Leaf and handle multi-character puncts 2022-12-27 18:23:01 +09:00
Lukas Wirth
78f33c0e96 Expand unmatched mbe fragments to reasonable default token trees
Currently we expand unmatched fragments by not replacing them at all,
leaving us with `$ident`. This trips up the parser or subsequent macro
calls. Instead it makes more sense to replace these with some reasonable
default depending on the fragment kind which should make more recursive
macro calls work better for completions.
2022-10-10 14:27:05 +02:00
Amos Wenger
816f7fe12a Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
Jonas Schievink
df66eb74ab Implement ignore and index metavar expression 2022-07-11 18:31:42 +02:00
Tim Neumann
40bfb29e50 feat: Support $$ in macros.
The implementation mirrors what `rustc` currently does [1]. Part of #11952.

[1]: 0595ea1d12/compiler/rustc_expand/src/mbe/quoted.rs (L230-L241)
2022-06-02 21:48:28 +02:00
Lukas Wirth
2ad71f1350 Shrink mbe::ExpandError and mbe::ParseError 2022-02-03 17:25:24 +01:00
Lukas Wirth
f31863b189 minor: Simplify 2022-01-02 17:37:16 +01:00
Lukas Wirth
a0e0e4575b Simplify 2022-01-02 02:39:14 +01:00
Aleksey Kladov
4e352275d1 minor: simplify 2021-10-02 20:38:39 +03:00
Aleksey Kladov
613609cc5e minor: cleanup 2021-10-02 20:38:39 +03:00
Aleksey Kladov
77bf761203 internal: move code to where it's used and reduce visibility 2021-10-02 20:38:39 +03:00
Maan2003
c9b4ac5be4
clippy::redudant_borrow 2021-06-13 09:24:16 +05:30
Clemens Wasser
629e8d1ed0 Apply more clippy suggestions and update generated 2021-06-03 12:46:56 +02:00
Matthias Krüger
202b51bc7b a lot of clippy::style fixes 2021-03-21 16:15:41 +01:00
Kevin Mehall
0a0e22235b Make bare underscore token an Ident rather than Punct in proc-macro 2021-03-20 12:28:44 -06:00
Matthias Krüger
048dad8c2e don't clone types that are copy (clippy::clone_on_copy) 2021-03-17 01:56:31 +01:00
Edwin Cheng
cff2201c30 NFA parser for mbe matcher 2021-03-01 00:11:14 +08:00
Edwin Cheng
438b34dcee Simpilfy mbe parsing 2021-01-30 16:12:30 +08:00
Edwin Cheng
706ac8256d Simplify mbe match error.
Handle parse error in rule parsing instead of match in mbe
2021-01-30 00:21:43 +08:00
Edwin Cheng
74a24adc8e Fix bug when $crate in LHS in mbe 2021-01-08 14:00:16 +08:00
Edwin Cheng
76f2b9d2ef Proper handling $crate Take 2 2021-01-07 13:08:32 +08:00
Jonas Schievink
85cc3cfec9
Revert "Proper handling $crate and local_inner_macros" 2021-01-03 11:47:57 +01:00
Edwin Cheng
fe5340d970 Introduce HygieneFrames for proper token hyginee 2021-01-02 20:39:57 +08:00
Edwin Cheng
266b14d4b5 Refactor mbe parsing code 2020-12-30 02:51:06 +08:00
Edwin Cheng
b5c29af02a Special case underscore in mbe meta op 2020-12-28 18:51:43 +08:00
Laurențiu Nicola
75a26f64ff mbe: treat _ as ident 2020-12-20 08:06:17 +02:00
Aleksey Kladov
2f45cfc415 Rename ra_mbe -> mbe 2020-08-13 10:36:04 +02:00