Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | ssr: Allow replacing expressions with statements | Marijn Suijten | 2021-01-04 | 1 | -0/+47 |
| | | | | | | | | | | | | | | | | | Now that statements can be matched and replaced (#6587) some usecases require expressions to be replaced with statements as well. This happens when something that can ambiguously be an expression or statement like `if` and loop blocks appear in the last position of a block, as trailing expression. In this case a replacement pattern of the form `if foo(){$a();}==>>$a();` will only substitute `if` blocks in the list of statements but not if they (implicitly) end up in the trailing expression, where they are not wrapped by an EXPR_STMT (but the pattern and template are, as parsing only succeeds for the `stmt ==>> stmt` case). Instead of adding two rules that match an expression - and emit duplicate matching errors - allow the template for expressions to be a statement if it fails to parse as an expression. | ||||
* | ssr: Add tests for raw LetStmt matching | Marijn Suijten | 2021-01-03 | 1 | -0/+44 |
| | |||||
* | Re-export base_db from ide_db | Igor Aleksanov | 2020-10-24 | 1 | -3/+3 |
| | |||||
* | Switch to expect_test from crates.io | Aleksey Kladov | 2020-08-21 | 1 | -1/+1 |
| | |||||
* | SSR: A few small refactorings | David Lattimore | 2020-08-18 | 1 | -0/+1 |
| | |||||
* | SSR: Explicitly autoderef and ref placeholders as needed | David Lattimore | 2020-08-14 | 1 | -0/+106 |
| | | | | Structured search replace now inserts *, & and &mut in the replacement to match any auto[de]ref in the matched code. | ||||
* | Refactor SSR so that placeholders store a Var | David Lattimore | 2020-08-14 | 1 | -1/+1 |
| | | | | | This allows lookup of placeholder bindings given a placeholder without needing to create a Var instance. | ||||
* | Rename ra_ssr -> ssr | Aleksey Kladov | 2020-08-13 | 1 | -0/+1174 |