Skip to content

Commit 329c583

Browse files
committed
refactor(parser): remove redundant comments (#27831)
Remove five comments that restate the adjacent operations in parser error handling and expression parsing.
1 parent 03fd498 commit 329c583

3 files changed

Lines changed: 0 additions & 5 deletions

File tree

‎crates/oxc_parser/src/error_handler.rs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ impl<'a, C: Config> ParserImpl<'a, C> {
3030
return;
3131
}
3232

33-
// Check if this looks like a merge conflict marker
3433
if let Some(start_span) = self.is_merge_conflict_marker() {
3534
let (middle_span, end_span) = self.find_merge_conflict_markers();
3635
let error = diagnostics::merge_conflict_marker(start_span, middle_span, end_span);
@@ -139,7 +138,6 @@ impl<C: Config> ParserImpl<'_, C> {
139138
return None;
140139
}
141140

142-
// Get the remaining source text from the current position
143141
let remaining = &self.source_text[span.start as usize..];
144142

145143
// Check for each conflict marker pattern (all are exactly 7 ASCII characters)
@@ -193,7 +191,6 @@ impl<C: Config> ParserImpl<'_, C> {
193191
return (middle_span, None);
194192
}
195193

196-
// Check if we've hit a conflict marker
197194
if let Some(marker_span) = self.is_merge_conflict_marker() {
198195
let span = self.cur_token().span();
199196
let remaining = &self.source_text[span.start as usize..];

‎crates/oxc_parser/src/js/arrow.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,6 @@ impl<'a, C: Config> ParserImpl<'a, C> {
322322
self.context_add(Context::In, Self::parse_function_body),
323323
)
324324
} else {
325-
// Remove TopLevel context for arrow function expression body
326325
let expr = self.context_remove(Context::TopLevel, |p| {
327326
p.parse_assignment_expression_or_higher_impl(allow_return_type_in_arrow_function)
328327
});

‎crates/oxc_parser/src/js/expression.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,6 @@ impl<'a, C: Config> ParserImpl<'a, C> {
630630
_ => unreachable!(),
631631
};
632632

633-
// Get `raw`
634633
let raw_span = self.cur_token().span();
635634
let mut raw = Str::from(
636635
&self.source_text[raw_span.start as usize + 1..(raw_span.end - end_offset) as usize],

0 commit comments

Comments
 (0)