mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
G: where clause
This commit is contained in:
parent
2ef16a4121
commit
dd6e5371eb
4 changed files with 14 additions and 8 deletions
|
@ -114,6 +114,7 @@ Grammar(
|
|||
"ALIAS",
|
||||
"VISIBILITY",
|
||||
"TYPE_PARAM_LIST",
|
||||
"WHERE_CLAUSE",
|
||||
"LIFETIME_PARAM",
|
||||
"TYPE_PARAM",
|
||||
"ABI",
|
||||
|
|
|
@ -70,9 +70,11 @@ pub(super) fn list(p: &mut Parser) {
|
|||
|
||||
pub(super) fn where_clause(p: &mut Parser) {
|
||||
if p.at(WHERE_KW) {
|
||||
let m = p.start();
|
||||
p.bump();
|
||||
p.expect(IDENT);
|
||||
p.expect(COLON);
|
||||
p.expect(IDENT);
|
||||
m.complete(p, WHERE_CLAUSE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,6 +112,7 @@ pub enum SyntaxKind {
|
|||
ALIAS,
|
||||
VISIBILITY,
|
||||
TYPE_PARAM_LIST,
|
||||
WHERE_CLAUSE,
|
||||
LIFETIME_PARAM,
|
||||
TYPE_PARAM,
|
||||
ABI,
|
||||
|
@ -234,6 +235,7 @@ impl SyntaxKind {
|
|||
ALIAS => &SyntaxInfo { name: "ALIAS" },
|
||||
VISIBILITY => &SyntaxInfo { name: "VISIBILITY" },
|
||||
TYPE_PARAM_LIST => &SyntaxInfo { name: "TYPE_PARAM_LIST" },
|
||||
WHERE_CLAUSE => &SyntaxInfo { name: "WHERE_CLAUSE" },
|
||||
LIFETIME_PARAM => &SyntaxInfo { name: "LIFETIME_PARAM" },
|
||||
TYPE_PARAM => &SyntaxInfo { name: "TYPE_PARAM" },
|
||||
ABI => &SyntaxInfo { name: "ABI" },
|
||||
|
|
|
@ -3,6 +3,7 @@ FILE@[0; 31)
|
|||
TYPE_KW@[0; 4)
|
||||
WHITESPACE@[4; 5)
|
||||
IDENT@[5; 8) "Foo"
|
||||
WHERE_CLAUSE@[8; 25)
|
||||
WHITESPACE@[8; 9)
|
||||
WHERE_KW@[9; 14)
|
||||
WHITESPACE@[14; 15)
|
||||
|
|
Loading…
Reference in a new issue