Skip to content

Commit cd8a7d5

Browse files
committed
Fix more parsing hard failures
1 parent 5540ff0 commit cd8a7d5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/parser/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -9292,20 +9292,20 @@ impl<'a> Parser<'a> {
92929292
return self.expected("literal number", next_token);
92939293
};
92949294
self.expect_token(&Token::RBrace)?;
9295-
RepetitionQuantifier::AtMost(n.parse().expect("literal int"))
9295+
RepetitionQuantifier::AtMost(Self::parse(n, token.location)?)
92969296
}
92979297
Token::Number(n, _) if self.consume_token(&Token::Comma) => {
92989298
let next_token = self.next_token();
92999299
match next_token.token {
93009300
Token::Number(m, _) => {
93019301
self.expect_token(&Token::RBrace)?;
93029302
RepetitionQuantifier::Range(
9303-
n.parse().expect("literal int"),
9304-
m.parse().expect("literal int"),
9303+
Self::parse(n, token.location)?,
9304+
Self::parse(m, token.location)?,
93059305
)
93069306
}
93079307
Token::RBrace => {
9308-
RepetitionQuantifier::AtLeast(n.parse().expect("literal int"))
9308+
RepetitionQuantifier::AtLeast(Self::parse(n, token.location)?)
93099309
}
93109310
_ => {
93119311
return self.expected("} or upper bound", next_token);
@@ -9314,7 +9314,7 @@ impl<'a> Parser<'a> {
93149314
}
93159315
Token::Number(n, _) => {
93169316
self.expect_token(&Token::RBrace)?;
9317-
RepetitionQuantifier::Exactly(n.parse().expect("literal int"))
9317+
RepetitionQuantifier::Exactly(Self::parse(n, token.location)?)
93189318
}
93199319
_ => return self.expected("quantifier range", token),
93209320
}

0 commit comments

Comments
 (0)