Add validation for mutable const items

This commit is contained in:
Lukas Wirth 2021-01-24 02:17:41 +01:00
parent 89fef5307e
commit 70d43c3faf
6 changed files with 40 additions and 25 deletions

View file

@ -13,7 +13,7 @@ pub(super) fn konst(p: &mut Parser, m: Marker) {
fn const_or_static(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) {
assert!(p.at(kw));
p.bump(kw);
p.eat(T![mut]); // FIXME: validator to forbid const mut
p.eat(T![mut]);
// Allow `_` in place of an identifier in a `const`.
let is_const_underscore = kw == T![const] && p.eat(T![_]);