Chayim Refael Friedman
32d50921d6
Remove Rust ungram file from the Ungrammar repo
...
It can be confused with the real Rust ungram, now that they're in the same repo.
2025-12-16 21:59:12 +02:00
Laurențiu Nicola
f0ecddb3fc
Fix elided lifetime
2025-11-18 14:06:52 +02:00
Laurențiu Nicola
c9a7c9c66b
Drop unused ungrammar import
2025-11-18 13:12:03 +02:00
Lukas Wirth
1b62ceb886
Merge pull request #21002 from Veykril/veykril/push-nztxvpnntmrx
...
lib: Bump editions to 2024 and remove legacy files
2025-11-15 09:17:16 +02:00
Lukas Wirth
ee3c21fb61
Reformat
2025-11-15 09:16:57 +02:00
Alona Enraght-Moony
397b7bc9b9
implement Clone for Rule
2025-11-11 16:48:08 +02:00
Lukas Wirth
63f54d1c82
Update rust.ungram
2024-04-18 17:12:18 +02:00
tison
50fc09bad3
Update repo link in Cargo.toml
2023-07-01 15:13:32 +08:00
Eli Bendersky
f9536e9e63
Update ungrammar.ungram with proper labeled rule
...
Labels are followed by rules
The ungrammar listed in https://rust-analyzer.github.io/blog/2020/10/24/introducing-ungrammar.html seems to be correct
2023-06-19 08:42:25 -07:00
Lukas Wirth
8dc8fadaab
Include Self specifically in NameRef
2022-03-05 22:48:00 +01:00
Chayim Refael Friedman
d6ad4dadfb
Support destructuring assignments (RFC 2909)
...
The supported patterns are already valid as expressions, except the rest pattern (`..`) and the wildcard pattern (`_`).
2022-02-25 01:05:27 +00:00
Chayim Refael Friedman
5311fcfe87
Revert the visibility removal of macro_rules visibility ( #46 )
...
As discussed in https://github.com/rust-analyzer/ungrammar/pull/46#issuecomment-1049758027 .
2022-02-24 14:20:36 +02:00
Lukas Wirth
0df282200f
Fix some rust.ungram inconsistencies
2022-02-08 13:51:44 +01:00
Chayim Refael Friedman
cdcc889098
Support if- and while-let chains
...
RFC 2497 https://github.com/rust-lang/rfcs/blob/master/text/2497-if-let-chains.md .
2022-01-24 05:06:10 +02:00
Lukas Wirth
8afbe1816a
Add ~const bounds to rust grammar
2021-10-19 14:14:31 +02:00
Jonas Schievink
012fa6e256
Make LetElse its own node
2021-10-07 16:59:49 +02:00
Jonas Schievink
2e66cedc8b
Add support for let ... else
2021-10-06 18:15:06 +02:00
zhoufan
c284772def
add Attr to RestPat
2021-10-03 08:49:18 +08:00
Aleksey Kladov
31eabf6fb8
bump version
2021-09-26 19:13:22 +03:00
Aleksey Kladov
7eb4702193
canonical grammar for block expressions
...
Historically, we struggled with formulating the right grammar for block
expressions. Today's EffectExpr is the best we've come up so far, but,
if you are thinking "WTF is an effect expression?", you are not wrong.
I think in this commit I've come up with what can be called a reasonable
grammar for block expressions. Observe that *all* things in `{}` we call
list: item list, assoc item list, match arm list, record field list,
record expr field list. In fact, `BlockExpr` is the only exception.
So, let's just call the stuff in `{}` a statement list. This isn't
forced: *all* things inside a block are statements, and `;` is a
statement separator, just like `,`. Trailing `;` is allowed, but not
required.
Then, statement list with modifiers such as `async` or attributes or
labels is just a block expression.
Why haven't I thought of it from the start?
2021-09-26 13:47:12 +03:00
Aleksey Kladov
378b78511d
avoid attribute ambiguity in ExprStmt
...
Both expr stmt and expr can have attributes, which doesn't make sense.
Let's say that statement's attrs are those of the expression.
2021-09-26 12:00:56 +03:00
Ariel Davis
349b99a690
Add ungrammar extensions
2021-09-13 20:37:39 -07:00
Jade
d3d8c90b44
Bump version and remove soft-deprecated authors field
2021-08-12 19:11:45 -07:00
Jade
e1ba93fd2a
Add both variants of half open range patterns to the grammar
...
This is prompted by
https://github.com/rust-analyzer/rust-analyzer/issues/9779 , but it
is not actually a prerequisite of making that one happen as this commit
doesn't change the generated code on the r-a side.
2021-08-12 19:11:21 -07:00
Jonas Schievink
22b383537a
Add syntax elements for if let match guards
2021-08-13 00:07:57 +02:00
Lukas Wirth
4cd55e16ed
Add GenericParamList to AssocTypeArg
2021-07-17 13:41:38 +02:00
bors[bot]
4457576f49
Merge rust-analyzer/ungrammar#35
...
35: More specific error for leading pipes r=matklad a=ammkrn
Re: rust-analyzer/ungrammar#34 ; return a more detailed error message when counting an improperly placed leading pipe.
Co-authored-by: ammkrn <ammkrn@tuta.io>
2021-06-19 18:11:59 +00:00
ammkrn
67df3a6923
More specific error for leading pipes
2021-06-19 12:46:05 -05:00
Aleksey Kladov
8b5bd1f348
fix indentation
2021-06-19 17:30:37 +03:00
Jonas Schievink
8f2eb62d60
Bump to 1.14.0
2021-06-11 18:27:11 +02:00
Jonas Schievink
5c31636784
Add a Meta node representing attribute contents
2021-06-11 18:12:35 +02:00
Christopher Durham
74dd9c4961
Report 1-based indices in Error's Display impl
...
This matches every (mainstream) text editor's use of the line:column format.
2021-05-01 22:56:42 -05:00
Lukas Wirth
cbf13ef775
extended_key_value_attributes
2021-03-18 22:14:02 +01:00
bors[bot]
6cc1ad0181
Merge rust-analyzer/ungrammar#29
...
29: Macro Statements should be also an Expr r=jonas-schievink a=edwin0cheng
e.g:
```rust
macro_rules! identity { ($($es:tt)*) => { $($es)* } }
fn main() -> usize {
identity! { let _ = (); } // statements
identity! { let _ = (); 0 } // expr, return 0
}
```
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2021-03-15 14:21:33 +00:00
Jonas Schievink
7359cc1c20
Restore current version
2021-03-15 14:46:34 +01:00
Jonas Schievink
5a3b0beb82
Revert "Split out macro calls in item position"
...
This reverts commit 2e379beecbe64fe3a07cdecc3b2d701dedc90e69.
2021-03-15 14:44:32 +01:00
Jonas Schievink
4d78478eca
Revert "Make ExternItem and AssocItem use MacroItem"
...
This reverts commit 801f8e63f7be65a8dcac6a2034dacb76590a6fb5.
2021-03-15 14:44:27 +01:00
Edwin Cheng
1362a27f2a
Macro Statements should be expr
2021-03-08 12:59:34 +08:00
Jonas Schievink
801f8e63f7
Make ExternItem and AssocItem use MacroItem
2021-02-18 19:18:10 +01:00
Jonas Schievink
2e379beecb
Split out macro calls in item position
2021-02-18 14:47:43 +01:00
Aleksey Kladov
51ad79eff8
adt
2021-02-07 14:10:38 +03:00
Ariel Davis
f36cf5191c
Bump minor version
2021-01-22 01:25:03 -08:00
Ariel Davis
273c6111c6
Fix typo
2021-01-21 19:26:35 -08:00
Ariel Davis
67a8915f99
Add more doc
2021-01-21 19:25:10 -08:00
Ariel Davis
be849cff34
Pluralize
2021-01-21 19:20:08 -08:00
Ariel Davis
4bd07ea83d
Fix typo
2021-01-21 19:07:50 -08:00
Ariel Davis
43c5100d8e
Reorder
2021-01-21 18:59:59 -08:00
Ariel Davis
1f3d4b0240
Write docs
2021-01-21 18:59:29 -08:00
Ariel Davis
6a852911c4
Add a tokens iterator
2021-01-21 18:47:52 -08:00
Ariel Davis
e47679164c
Derive more for Node and Token
2021-01-21 18:46:51 -08:00