fix(parser): comments in subexpressions of let/mut (#15375)

Closes #15305

# Description

Basically turns off `skip_comments` of the lex function for right hand
side expressions of `let`/`mut`, just as in `parse_const`.

# User-Facing Changes

Should be none.

# Tests + Formatting

+1

# After Submitting
This commit is contained in:
zc he
2025-03-26 04:28:06 +08:00
committed by GitHub
parent e10ac2ede6
commit 55e05be0d8
3 changed files with 43 additions and 5 deletions

View File

@ -3331,7 +3331,7 @@ pub fn parse_let(working_set: &mut StateWorkingSet, spans: &[Span]) -> Pipeline
spans[span.0 + 1].start,
&[],
&[],
true,
false,
);
if let Some(parse_error) = parse_error {
@ -3613,7 +3613,7 @@ pub fn parse_mut(working_set: &mut StateWorkingSet, spans: &[Span]) -> Pipeline
spans[span.0 + 1].start,
&[],
&[],
true,
false,
);
if let Some(parse_error) = parse_error {

View File

@ -5208,7 +5208,7 @@ pub fn parse_assignment_expression(
rhs_span.start,
&[],
&[],
true,
false,
);
working_set.parse_errors.extend(rhs_error);