about summary refs log tree commit diff
path: root/crates/syntax
AgeCommit message (Collapse)AuthorLines
2021-10-05Replace `if let Some(_) = foo` with `if foo.is_some()`Aramis Razzaghipour-1/+1
2021-10-04make Some(1..) parsedzhoufan-89/+170
2021-10-03Fix miscellaneous Clippy lintsAramis Razzaghipour-20/+18
2021-10-03Add semicolons for consistencyAramis Razzaghipour-45/+45
`clippy::semicolon_if_nothing_returned`
2021-10-03Merge #10438bors[bot]-2/+40
10438: minor: Simplify r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-10-03minor: SimplifyLukas Wirth-2/+40
2021-10-03fix: await insertion with try_expr during extract_functionvi_mi-0/+3
2021-10-03move outer_attrs call before the matchzhoufan-1/+1
2021-10-02minor: dead codeAleksey Kladov-8/+1
2021-10-02internal: remove deprecated methodAleksey Kladov-3/+0
2021-10-02minor: regenAleksey Kladov-0/+149
2021-10-02minor: generated code readabilityAleksey Kladov-1/+2
2021-10-02Parse outer attributes on StructPatternEtCeterazhoufan-10/+56
2021-09-28Fix inline_call breaking RecordExprField shorthandsLukas Wirth-0/+29
2021-09-27Rename `*Owner` traits to `Has*`Lukas Wirth-240/+240
2021-09-27Rename `Dyn*` nodes to `Any*` nodesLukas Wirth-61/+61
2021-09-26internal: more reasonable grammar for blocksAleksey Kladov-11028/+11401
Consider these expples { 92 } async { 92 } 'a: { 92 } #[a] { 92 } Previously the tree for them were BLOCK_EXPR { ... } EFFECT_EXPR async BLOCK_EXPR { ... } EFFECT_EXPR 'a: BLOCK_EXPR { ... } BLOCK_EXPR #[a] { ... } As you see, it gets progressively worse :) The last two items are especially odd. The last one even violates the balanced curleys invariant we have (#10357) The new approach is to say that the stuff in `{}` is stmt_list, and the block is stmt_list + optional modifiers BLOCK_EXPR STMT_LIST { ... } BLOCK_EXPR async STMT_LIST { ... } BLOCK_EXPR 'a: STMT_LIST { ... } BLOCK_EXPR #[a] STMT_LIST { ... }
2021-09-26Merge #10358bors[bot]-220/+15
10358: internal: Remove inherent methods from ast nodes that do non-syntactic complex tasks r=Veykril a=Veykril Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-26Remove inherent methods from ast node that carry semantic meaningLukas Wirth-220/+15
2021-09-26internal: fix and force-disable block validation ;-(Aleksey Kladov-8/+5
Originally we tried to maintain the invariant that `{}` always match. That is, that in the parse tree the pair of corresponding `{}` is always first and last tokens of some nodes. We had the code to validate that, but apparently it's been broken for **years** since we introduced tokens/nodes split. Fixing it now makes some tests fail. It's unclear if we want to keep this invariant: there's a strong motivation for breaking it in the following case: ``` use std::{ // unclosed paren fn main() { } } // don't actually want to pair up this with the one from `use` ``` So let's fix the code, but disable it for the time being
2021-09-25feat: allow attributes on all expressionsAleksey Kladov-239/+222
Attrs are syntactically valid on any expression, even if they are not allowed semantically everywhere yet.
2021-09-25Merge #10346bors[bot]-33/+35
10346: minor: align code with code-style r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-09-25minor: align code with code-styleAleksey Kladov-33/+35
2021-09-25minore: improve consistencyAleksey Kladov-8/+8
2021-09-25minor: more condensed testsAleksey Kladov-126/+122
2021-09-25minor: more focusted testsAleksey Kladov-134/+94
2021-09-23CleanupLukas Wirth-0/+10
2021-09-21SimplifyLukas Wirth-110/+9
2021-09-21SimplifyLukas Wirth-170/+111
2021-09-21Generate ast nodes for each ast traitLukas Wirth-32/+461
2021-09-19Merge #10289bors[bot]-3/+4
10289: fix: Only strip derive attributes when preparing macro input r=Veykril a=Veykril Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10246 cc https://github.com/rust-analyzer/rowan/pull/114, follow up to https://github.com/rust-analyzer/rust-analyzer/pull/10025 Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-19Only strip derive attributes when preparing macro inputLukas Wirth-3/+4
2021-09-19SimplifyLukas Wirth-7/+4
2021-09-19SimplifyLukas Wirth-2/+2
2021-09-19internal: more focused tests for const argumentsAleksey Kladov-166/+299
2021-09-19fix: don't allow two turbo-fishes in generic argumentsAleksey Kladov-32/+38
2021-09-19internal: add erroneous test for double turbo fishAleksey Kladov-0/+122
We parse `f` successfully, but that is a bug.
2021-09-18minor: improve readabilityAleksey Kladov-0/+0
2021-09-18internal: parser cleanupAleksey Kladov-71/+131
2021-09-18internal: minimize use_tree parser testsAleksey Kladov-504/+276
The code here is intentionally dense and does exactly what is written. Explaining semantic difference between Rust 2015 and 2018 doesn't help with understanding syntax. Better to just add more targeted tests.
2021-09-18internal: parser cleanupsAleksey Kladov-65/+46
2021-09-18internal: more focused trait item parsing testsAleksey Kladov-221/+224
2021-09-18intenral: more local tests for staticsAleksey Kladov-40/+42
2021-09-18internal: cleanup adt parsingAleksey Kladov-130/+51
2021-09-18internal: cleanup item parsingAleksey Kladov-35/+0
2021-09-17Merge #10265bors[bot]-359/+424
10265: internal: parser cleanups r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-09-17internal: more local parsing tests for macrosAleksey Kladov-141/+141
2021-09-17internal: more focused parsing testsAleksey Kladov-123/+160
2021-09-17internal: more local test for mod itemAleksey Kladov-95/+95
2021-09-17internal: more local parsing testsAleksey Kladov-0/+28