parse_util: fix regressions from port

Tested by the upcoming highlighting unit tests.
This commit is contained in:
Johannes Altmanninger 2023-09-17 18:02:19 +02:00
parent c7c0bb9bb2
commit 2334424234

View File

@ -52,7 +52,6 @@ pub fn parse_util_slice_length(input: &wstr) -> Option<usize> {
if !escaped {
if ['\'', '"'].contains(&c) {
pos = quote_end(input, pos, c)?;
}
} else if c == openc {
bracket_count += 1;
} else if c == closec {
@ -62,6 +61,7 @@ pub fn parse_util_slice_length(input: &wstr) -> Option<usize> {
return Some(pos + 1);
}
}
}
if c == '\\' {
escaped = !escaped;
} else {
@ -1013,8 +1013,8 @@ pub fn parse_util_detect_errors(
if !parse_errors.is_empty() {
if let Some(errors) = out_errors.as_mut() {
errors.extend(parse_errors);
return Err(ParserTestErrorBits::ERROR);
}
return Err(ParserTestErrorBits::ERROR);
}
// Defer to the tree-walking version.