Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/oxc_parser/src/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ impl<'a> ParserImpl<'a> {

/// Advance and return true if we are at `Kind`, return false otherwise
#[inline]
#[must_use = "Use `bump` instead of `eat` if you are ignoring the return value"]
pub(crate) fn eat(&mut self, kind: Kind) -> bool {
if self.at(kind) {
self.advance(kind);
Expand All @@ -144,7 +145,7 @@ impl<'a> ParserImpl<'a> {
false
}

/// Advance and return true if we are at `Kind`
/// Advance if we are at `Kind`
#[inline]
pub(crate) fn bump(&mut self, kind: Kind) {
if self.at(kind) {
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_parser/src/js/declaration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl<'a> ParserImpl<'a> {
&& self.at(Kind::Bang)
&& !self.cur_token().is_on_new_line()
{
self.eat(Kind::Bang);
self.bump(Kind::Bang);
definite = true;
}
let optional = self.eat(Kind::Question); // not allowed, but checked in checker/typescript.rs
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_parser/src/js/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl<'a> ParserImpl<'a> {
Self::parse_object_expression_property,
)
});
self.eat(Kind::Comma); // Trailing Comma
self.bump(Kind::Comma); // Trailing Comma
self.expect(Kind::RCurly);
self.ast.alloc_object_expression(self.end_span(span), object_expression_properties)
}
Expand Down
Loading