diff --git a/src/parser/parsing/unchecked/mod.rs b/src/parser/parsing/unchecked/mod.rs index 41aab77..7869a43 100644 --- a/src/parser/parsing/unchecked/mod.rs +++ b/src/parser/parsing/unchecked/mod.rs @@ -193,14 +193,26 @@ impl Parser { let attribute = match keyword { AttributeKeyword::derive => { - let string_literal = self.parse_bracket_string_literal()?; - match string_literal.content.as_str() { + self.expect(token![CurvedBracketOpen])?; + let string_literal_token = self.expect(token![Identifier])?; + let string_literal = + if let TokenKind::Identifier(ident) = string_literal_token.kind() { + ident + } else { + unreachable! {"The token is a identifier, as checked by the `expect`"}; + }; + self.expect(token![CurvedBracketClose])?; + + match string_literal.as_str() { "Error" => Ok(Attribute::derive { value: DeriveValue::Error, span, }), _ => Err(error::ParsingError::WrongDeriveValue { - specified: string_literal, + specified: StringLiteral { + content: string_literal.to_owned(), + span: string_literal_token.span, + }, }), } }