Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/grammar/attributes.rs')
-rw-r--r--crates/parser/src/grammar/attributes.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/crates/parser/src/grammar/attributes.rs b/crates/parser/src/grammar/attributes.rs
index ccb556b2cc..54b5c8a275 100644
--- a/crates/parser/src/grammar/attributes.rs
+++ b/crates/parser/src/grammar/attributes.rs
@@ -24,15 +24,11 @@ fn attr(p: &mut Parser<'_>, inner: bool) {
p.bump(T![!]);
}
- if p.eat(T!['[']) {
+ if p.expect(T!['[']) {
meta(p);
-
- if !p.eat(T![']']) {
- p.error("expected `]`");
- }
- } else {
- p.error("expected `[`");
+ p.expect(T![']']);
}
+
attr.complete(p, ATTR);
}