aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar/items/consts.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_parser/src/grammar/items/consts.rs')
-rw-r--r--crates/ra_parser/src/grammar/items/consts.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_parser/src/grammar/items/consts.rs b/crates/ra_parser/src/grammar/items/consts.rs
index 1f802246f..b4908ebba 100644
--- a/crates/ra_parser/src/grammar/items/consts.rs
+++ b/crates/ra_parser/src/grammar/items/consts.rs
@@ -1,22 +1,22 @@
1use super::*; 1use super::*;
2 2
3pub(super) fn static_def(p: &mut Parser, m: Marker) { 3pub(super) fn static_def(p: &mut Parser, m: Marker) {
4 const_or_static(p, m, STATIC_KW, STATIC_DEF) 4 const_or_static(p, m, T![static], STATIC_DEF)
5} 5}
6 6
7pub(super) fn const_def(p: &mut Parser, m: Marker) { 7pub(super) fn const_def(p: &mut Parser, m: Marker) {
8 const_or_static(p, m, CONST_KW, CONST_DEF) 8 const_or_static(p, m, T![const], CONST_DEF)
9} 9}
10 10
11fn const_or_static(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) { 11fn const_or_static(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) {
12 assert!(p.at(kw)); 12 assert!(p.at(kw));
13 p.bump(); 13 p.bump();
14 p.eat(MUT_KW); // FIXME: validator to forbid const mut 14 p.eat(T![mut]); // FIXME: validator to forbid const mut
15 name(p); 15 name(p);
16 types::ascription(p); 16 types::ascription(p);
17 if p.eat(EQ) { 17 if p.eat(T![=]) {
18 expressions::expr(p); 18 expressions::expr(p);
19 } 19 }
20 p.expect(SEMI); 20 p.expect(T![;]);
21 m.complete(p, def); 21 m.complete(p, def);
22} 22}