about summary refs log tree commit diff
path: root/src/tools/rust-analyzer/crates/mbe
AgeCommit message (Collapse)AuthorLines
2025-03-08Fix syntax fixup producing invalid punctuation¨Florian-0/+17
Fixes #19206. Fixes #18244.
2025-02-27fix doc testsBenjaminBrienen-2/+2
2025-02-27enable doctestBenjaminBrienen-1/+0
2025-01-13Fix another bug when reaching macro expansion limit caused a stack overflowChayim Refael Friedman-0/+5
This time without missing bindings. Solve it by returning to the old ways, i.e. just throw the extra nodes away. In other words, I acknowledge defeat.
2025-01-09Merge pull request #18861 from ChayimFriedman2/await-editionLukas Wirth-85/+95
fix: Make edition per-token, not per-file
2025-01-09Make edition per-token, not per-fileChayim Refael Friedman-85/+95
More correctly, *also* per-token. Because as it turns out, while the top-level edition affects parsing (I think), the per-token edition affects escaping of identifiers/keywords.
2025-01-07Fix a bug with missing binding in MBEChayim Refael Friedman-1/+4
We should immediately mark them as finished, on the first entry. The funny (or sad) part was that this bug was pre-existing, but previously to #18327, it was causing us to generate bindings non-stop, 65535 of them, until we get to the hardcoded repetition limit, and then throw it all away. And it was so Blazingly Fast that nobody noticed. With #18327 however, this is still what happens, except that now instead of *merging* the fragments into the result, we write them on-demand. Meaning that when we hit the limit, we've already written all previous entries. This is a minor change, I thought for myself when I was writing this, and it's actually for the better, so who cares. Minor change? Not so fast. This caused us to emit 65535 repetitions, all of which the MBE infra needs to handle when calling other macros with the expansion, and convert to rowan tree etc., which resulted a *massive* hang. The test (and also `analysis-stats`) used to crash with stack overflow on this macro, because we were dropping some crazily deep rowan tree. Now they work properly. Because I am lazy, and also because I could not find the exact conditions that causes a macro match but with a missing binding, I just copied all macros from tracing. Easy.
2025-01-07Drop unnecessary tracing::warnLukas Wirth-5/+0
We already emit an error
2025-01-06minor: New clippy lintsLukas Wirth-1/+1
2025-01-02Store token trees in contiguous `Vec` instead of as a treeChayim Refael Friedman-564/+433
I expected this to be faster (due to less allocations and better cache locality), but benchmarked it is not (neither it is slower). Memory usage, however, drops by ~50mb (of `analysis-stats .`). I guess tt construction is just not hot. This also simplifies using even less memory for token trees by compressing equal span, which I plan to do right after. Some workflows are more easily expressed with a flat tt, while some are better expressed with a tree. With the right helpers, though (which was mostly a matter of trial and error), even the worst workflows become very easy indeed.
2024-12-24Remove dangling outdated test moduleLukas Wirth-101/+0
2024-10-21fix: FIx mbe bench tests being iteration order dependentLukas Wirth-5/+8
2024-10-21Update ide testsLukas Wirth-1/+1
2024-09-25Add missing rustc_privateLaurențiu Nicola-0/+2
2024-09-20Auto merge of #18151 - ChayimFriedman2:metavar-concat, r=Veykrilbors-5/+149
feat: Support the `${concat(...)}` metavariable expression I didn't follow rustc precisely, because I think it does some things wrongly (or they are FIXME), but I only allowed more code, not less. So we're all fine. Closes #18145.
2024-09-19When checking for forbidden expr kind matches, account for rawnessChayim Refael Friedman-1/+1
An expression starting with `r#const` etc. should be accepted even in edition <=2021.
2024-09-19Support the `${concat(...)}` metavariable expressionChayim Refael Friedman-5/+149
I didn't follow rustc precisely, because I think it does some things wrongly (or they are FIXME), but I only allowed more code, not less. So we're all fine.
2024-09-18Auto merge of #18131 - ChayimFriedman2:macro-expand-dollar-crate, r=Veykrilbors-2/+9
fix: Get rid of `$crate` in expansions shown to the user Be it "Expand Macro Recursively", "Inline macro" or few other things. We replace it with the crate name, as should've always been. Probably fixes some issues, but I don't know what they are.
2024-09-18Get rid of `$crate` in expansions shown to the userChayim Refael Friedman-2/+9
Be it "Expand Macro Recursively", "Inline macro" or few other things. We replace it with the crate name, as should've always been.
2024-09-18feat: Implement `expr_2021`Shoyu Vanilla-21/+192
2024-09-01internal: Lay basic ground work for standalone mbe testsLukas Wirth-0/+182
2024-08-06Replace `[package.repository] = "…"` of published crates with ↵Vincent Esche-1/+1
`[package.repository.workspace] = true`
2024-08-06Add repository URL for published crates' missing `[package.repository]` fieldsVincent Esche-0/+1
2024-08-06Replace `"TBD"` with more helpful desciptions in published crates' ↵Vincent Esche-1/+1
`[package.description]` fields
2024-08-05Split out syntax-bridge into a separate crateLukas Wirth-1224/+9
2024-07-29Make basic use of spans for macro expansion errorsLukas Wirth-150/+152
2024-07-19Parse contextual dyn keyword properly in edition 2015Lukas Wirth-3/+2
2024-07-19Test macros doing edition dependent parsingLukas Wirth-39/+31
2024-07-18Encode edition within FileId in the hir layerLukas Wirth-2/+8
2024-07-17Add always disabled gen parse supportLukas Wirth-3/+8
2024-07-16Switch token trees to use SymbolsLukas Wirth-81/+90
2024-07-15Fix incorrect encoding of literals in the proc-macro-api on version 4Lukas Wirth-61/+4
2024-07-15Encode ident rawness and literal kind separately in tt::LeafLukas Wirth-78/+201
2024-07-03Fix up the syntax tree for macro 2.0Lukas Wirth-23/+22
2024-06-30Remove inline `rust_2018_idioms, unused_lifetimes` lint warn, Cargo.toml ↵Lukas Wirth-2/+0
already enforces this
2024-06-24move tt-iter into tt crateLukas Wirth-310/+152
2024-06-24Shrink mbe's OpLukas Wirth-24/+46
2024-06-12Auto merge of #17398 - Veykril:bogus-file, r=Veykrilbors-2/+2
internal: Remove FileId::BOGUS
2024-06-12internal: Remove FileId::BOGUSLukas Wirth-2/+2
2024-06-11Auto merge of #17392 - randomicon00:17242, r=Veykrilbors-6/+6
Change 'Length' to 'Len' This is a fix for #17242
2024-06-11edit: Length to Len in benchmarkrandomicon00-1/+1
2024-06-11edit: change 'Length' to 'Len'randomicon00-5/+5
2024-06-04Cleanup some inert attribute stuffLukas Wirth-0/+6
2024-04-27fix: Fix doc comment desugaring for proc-macrosLukas Wirth-26/+58
2024-04-21Allow rust files to be used linkedProjectsLukas Wirth-0/+4174