Cleanup ParserTestErrorBits harder

We don't need this bitwise operator override.
This commit is contained in:
Peter Ammon
2026-02-17 19:13:13 -08:00
parent b65649725e
commit d01a403c65
2 changed files with 7 additions and 22 deletions

View File

@@ -2,7 +2,6 @@
use crate::prelude::*;
use fish_fallback::{fish_wcswidth, fish_wcwidth};
use std::ops::{BitOr, BitOrAssign};
pub type SourceOffset = u32;
@@ -47,23 +46,6 @@ impl ParseIssue {
});
}
// Allow | and |= to combine ParseIssues.
impl BitOr for ParseIssue {
type Output = Self;
fn bitor(self, rhs: Self) -> Self {
Self {
error: self.error | rhs.error,
incomplete: self.incomplete | rhs.incomplete,
}
}
}
impl BitOrAssign for ParseIssue {
fn bitor_assign(&mut self, rhs: Self) {
*self = *self | rhs;
}
}
/// A range of source code.
#[derive(PartialEq, Eq, Clone, Copy, Debug, Default)]
pub struct SourceRange {

View File

@@ -1228,7 +1228,8 @@ pub fn detect_parse_errors_in_ast(
Kind::Argument(arg) => {
let arg_src = arg.source(buff_src);
if let Err(e) = detect_errors_in_argument(arg, arg_src, &mut out_errors) {
issue |= e;
issue.error |= e.error;
issue.incomplete |= e.incomplete;
}
}
Kind::JobPipeline(job) => {
@@ -1481,10 +1482,12 @@ pub fn detect_errors_in_argument(
out_errors,
);
let mut subst_errors = ParseErrorList::new();
issue |=
if let Err(e) =
detect_parse_errors(&arg_src[parens.command()], Some(&mut subst_errors), false)
.err()
.unwrap_or_default();
{
issue.error |= e.error;
issue.incomplete |= e.incomplete;
}
// Our command substitution produced error offsets relative to its source. Tweak the
// offsets of the errors in the command substitution to account for both its offset