Commit Graph

32 Commits

Author SHA1 Message Date
Aleksey Kladov
104cd0ce88 internal: make name consistent with usage 2021-09-06 18:34:03 +03:00
Aleksey Kladov
dbb702cfc1 internal: remove accidental code re-use
FragmentKind played two roles:

* entry point to the parser
* syntactic category of a macro call

These are different use-cases, and warrant different types. For example,
macro can't expand to visibility, but we have such fragment today.

This PR introduces `ExpandsTo` enum to separate this two use-cases.

I suspect we might further split `FragmentKind` into `$x:specifier` enum
specific to MBE, and a general parser entry point, but that's for
another PR!
2021-09-05 22:36:36 +03:00
Aleksey Kladov
81602f8a5d internal: reduce coupling
tt is a data structure, data structures cant' go wrong, they shouldn't
have the knowledge that the world outside of them has all kinds of
errors.
2021-08-31 19:14:33 +03:00
bors[bot]
fae440c32a
Merge #10025
10025: Don't mutate syntax trees when preparing proc-macro input r=Veykril a=Veykril

Fixes #10013

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-08-28 14:14:54 +00:00
Lukas Wirth
d6134b6802 Don't mutate syntax trees when preparing proc-macro input 2021-08-25 18:57:24 +02:00
Lukas Wirth
5fb8c0ddfd Remove MappedSubtree 2021-08-21 18:19:18 +02:00
Lukas Wirth
177c70128c Map attribute input tokens correctly 2021-08-21 18:13:41 +02:00
Aleksey Kladov
9aa6be71a5 internal: remove useless helpers
We generally avoid "syntax only" helper wrappers, which don't do much:
they make code easier to write, but harder to read. They also make
investigations harder, as "find_usages" needs to be invoked both for the
wrapped and unwrapped APIs
2021-08-09 15:58:21 +03:00
Clemens Wasser
47747cd412 Apply some clippy suggestions 2021-06-21 16:40:21 +02: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
Jonas Schievink
c8f40b1503 Fixup 2021-05-24 21:47:01 +02:00
Jonas Schievink
27bf62b70e Move TokenMap to its own file 2021-05-24 18:43:42 +02:00
Jonas Schievink
eaffdae300 Allow , to delimit macro 2.0 rules 2021-04-03 03:08:31 +02:00
Matthias Krüger
202b51bc7b a lot of clippy::style fixes 2021-03-21 16:15:41 +01:00
Laurențiu Nicola
fc9eed4836 Use upstream cov-mark 2021-03-08 22:19:44 +02:00
Edwin Cheng
cff2201c30 NFA parser for mbe matcher 2021-03-01 00:11:14 +08:00
Edwin Cheng
f5bf1a9650 Fix builtin macros split exprs on comma 2021-02-28 13:06:17 +08:00
Edwin Cheng
23dbf36c7d Add benchmark test for mbe 2021-02-25 05:47:13 +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
4c7d8cbfbf Rename mbe_expander for consistency 2021-01-29 20:23:38 +08:00
Edwin Cheng
ce4eeec1bf Support Macro v2 in mbe 2021-01-26 05:15:47 +08:00
Vincent Esche
586f84c730 Fixed typos in public type names 2021-01-09 15:41:29 +01:00
Edwin Cheng
ede1b11741 Remove unused clones in mbe 2020-12-31 02:58:41 +08:00
Edwin Cheng
266b14d4b5 Refactor mbe parsing code 2020-12-30 02:51:06 +08:00
Jonas Schievink
1b26520971 Add dedicated error for "proc macro not found" 2020-11-27 13:50:20 +01:00
Laurențiu Nicola
3aca697511 Simplify error formatting 2020-11-26 21:07:15 +02:00
Jonas Schievink
2c85db8eb6 Implement Display for macro expansion errors 2020-11-26 16:56:22 +01:00
Jonas Schievink
6a9338e979 Use ExpandResult instead of MacroResult
`MacroResult` is redundant
2020-11-26 16:48:17 +01:00
Jonas Schievink
c784c8ec76 Use named fields in ExpandResult 2020-11-26 16:04:23 +01:00
Aleksey Kladov
2f45cfc415 Rename ra_mbe -> mbe 2020-08-13 10:36:04 +02:00