Skip to content

Commit ca2e0e4

Browse files
committed
[parse] Fix validity identifier usage for particular parsing in attributes
If identifier is being parsed via `parse::<>`, use only `lexer.identifier()` because the `parse::<>` will handle any errors accordingly. Only when an identifier is directly used, the `parser.identifier()` must be used. Signed-off-by: Manas <manas18244@iiitd.ac.in>
1 parent e8d157d commit ca2e0e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ impl Parser {
182182

183183
while !self.lexer.is_token(Token::CBracket) {
184184
if self.lexer.is_token(Token::Identifier) {
185-
let attr = self.identifier()?.parse::<Attribute>()?;
185+
let attr = self.lexer.identifier().parse::<Attribute>()?;
186186
attrs.push(attr);
187187
self.lexer.consume(Token::Identifier)?;
188188
}

0 commit comments

Comments
 (0)