mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 21:33:09 +00:00
parse_util: fix regressions from port
Tested by the upcoming highlighting unit tests.
This commit is contained in:
parent
c7c0bb9bb2
commit
2334424234
1 changed files with 9 additions and 9 deletions
|
@ -52,14 +52,14 @@ 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 {
|
||||
bracket_count -= 1;
|
||||
if bracket_count == 0 {
|
||||
// pos points at the closing ], so add 1.
|
||||
return Some(pos + 1);
|
||||
} else if c == openc {
|
||||
bracket_count += 1;
|
||||
} else if c == closec {
|
||||
bracket_count -= 1;
|
||||
if bracket_count == 0 {
|
||||
// pos points at the closing ], so add 1.
|
||||
return Some(pos + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if c == '\\' {
|
||||
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue