diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-12-16 17:08:03 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-16 17:08:03 +0000 |
commit | 067067a6c11bb5afda98f5af14bfdec4744e7812 (patch) | |
tree | 1c0b6c4c78ee040ebdf818dada804fce311382a6 /crates/parser/src/grammar/items | |
parent | 63bbdb31e5148c804bbf940963c9c8f3481ad258 (diff) | |
parent | dd496223f50232fe98312ee8edc89eb4b5ee3d85 (diff) |
Merge #6896
6896: Node-ify lifetimes r=jonas-schievink a=Veykril
Let's see if this passes the tests 🤞
Depends on https://github.com/rust-analyzer/ungrammar/pull/15
Co-authored-by: Jonas Schievink <[email protected]>
Co-authored-by: Jonas Schievink <[email protected]>
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/parser/src/grammar/items')
-rw-r--r-- | crates/parser/src/grammar/items/traits.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/parser/src/grammar/items/traits.rs b/crates/parser/src/grammar/items/traits.rs index 8394020da..ab9a12b4d 100644 --- a/crates/parser/src/grammar/items/traits.rs +++ b/crates/parser/src/grammar/items/traits.rs | |||
@@ -98,10 +98,10 @@ fn choose_type_params_over_qpath(p: &Parser) -> bool { | |||
98 | // `<` `>` - empty generic parameters | 98 | // `<` `>` - empty generic parameters |
99 | // `<` `#` - generic parameters with attributes | 99 | // `<` `#` - generic parameters with attributes |
100 | // `<` `const` - const generic parameters | 100 | // `<` `const` - const generic parameters |
101 | // `<` (LIFETIME|IDENT) `>` - single generic parameter | 101 | // `<` (LIFETIME_IDENT|IDENT) `>` - single generic parameter |
102 | // `<` (LIFETIME|IDENT) `,` - first generic parameter in a list | 102 | // `<` (LIFETIME_IDENT|IDENT) `,` - first generic parameter in a list |
103 | // `<` (LIFETIME|IDENT) `:` - generic parameter with bounds | 103 | // `<` (LIFETIME_IDENT|IDENT) `:` - generic parameter with bounds |
104 | // `<` (LIFETIME|IDENT) `=` - generic parameter with a default | 104 | // `<` (LIFETIME_IDENT|IDENT) `=` - generic parameter with a default |
105 | // The only truly ambiguous case is | 105 | // The only truly ambiguous case is |
106 | // `<` IDENT `>` `::` IDENT ... | 106 | // `<` IDENT `>` `::` IDENT ... |
107 | // we disambiguate it in favor of generics (`impl<T> ::absolute::Path<T> { ... }`) | 107 | // we disambiguate it in favor of generics (`impl<T> ::absolute::Path<T> { ... }`) |
@@ -113,7 +113,7 @@ fn choose_type_params_over_qpath(p: &Parser) -> bool { | |||
113 | if p.nth(1) == T![#] || p.nth(1) == T![>] || p.nth(1) == CONST_KW { | 113 | if p.nth(1) == T![#] || p.nth(1) == T![>] || p.nth(1) == CONST_KW { |
114 | return true; | 114 | return true; |
115 | } | 115 | } |
116 | (p.nth(1) == LIFETIME || p.nth(1) == IDENT) | 116 | (p.nth(1) == LIFETIME_IDENT || p.nth(1) == IDENT) |
117 | && (p.nth(2) == T![>] || p.nth(2) == T![,] || p.nth(2) == T![:] || p.nth(2) == T![=]) | 117 | && (p.nth(2) == T![>] || p.nth(2) == T![,] || p.nth(2) == T![:] || p.nth(2) == T![=]) |
118 | } | 118 | } |
119 | 119 | ||