cargo fmt

This commit is contained in:
elvis
2025-12-15 17:00:14 +01:00
parent 35eb8d9a74
commit e983e778eb
2 changed files with 38 additions and 20 deletions

View File

@ -1320,8 +1320,7 @@ where
| Range::IterateOverSet(exp) => { | Range::IterateOverSet(exp) => {
let type_exp = typecheck_expression(exp, c)?; let type_exp = typecheck_expression(exp, c)?;
match type_exp { match type_exp {
| AssertionTypes::Set => | AssertionTypes::Set => Ok(AssertionTypes::RangeSet),
Ok(AssertionTypes::RangeSet),
| AssertionTypes::RangeNeighbours => | AssertionTypes::RangeNeighbours =>
Ok(AssertionTypes::RangeNeighbours), Ok(AssertionTypes::RangeNeighbours),
| AssertionTypes::RangeContexts => | AssertionTypes::RangeContexts =>

View File

@ -313,14 +313,17 @@ impl QualifierSystem {
} }
impl QualifierContext { impl QualifierContext {
pub(super) fn get(&self, l: &process::PositiveProcess) -> PositiveAssertReturnValue { pub(super) fn get(
&self,
l: &process::PositiveProcess,
) -> PositiveAssertReturnValue {
use process::PositiveProcess::*; use process::PositiveProcess::*;
match self { match self {
| Self::IsNill => PositiveAssertReturnValue::Boolean(matches!(l, Nill)), | Self::IsNill =>
| Self::IsIdentifier => PositiveAssertReturnValue::Boolean(matches!(l, Nill)),
PositiveAssertReturnValue::Boolean(matches!(l, RecursiveIdentifier { | Self::IsIdentifier => PositiveAssertReturnValue::Boolean(
identifier: _, matches!(l, RecursiveIdentifier { identifier: _ }),
})), ),
| Self::IsSet => | Self::IsSet =>
PositiveAssertReturnValue::Boolean(matches!(l, EntitySet { PositiveAssertReturnValue::Boolean(matches!(l, EntitySet {
entities: _, entities: _,
@ -341,9 +344,11 @@ impl QualifierContext {
PositiveAssertReturnValue::Boolean(matches!(l, Summation { PositiveAssertReturnValue::Boolean(matches!(l, Summation {
children: _, children: _,
})), })),
| Self::IsNondeterministicChoice => PositiveAssertReturnValue::Boolean( | Self::IsNondeterministicChoice =>
matches!(l, NondeterministicChoice { children: _ }), PositiveAssertReturnValue::Boolean(matches!(
), l,
NondeterministicChoice { children: _ }
)),
| Self::GetSet => PositiveAssertReturnValue::Set( | Self::GetSet => PositiveAssertReturnValue::Set(
if let EntitySet { if let EntitySet {
@ -503,7 +508,9 @@ impl PositiveUnary {
PositiveAssertionTypes::System, PositiveAssertionTypes::System,
) => Ok(PositiveAssertionTypes::Context), ) => Ok(PositiveAssertionTypes::Context),
| ( | (
Self::Qualifier(PositiveQualifier::Context(QualifierContext::IsNill)), Self::Qualifier(PositiveQualifier::Context(
QualifierContext::IsNill,
)),
PositiveAssertionTypes::Context, PositiveAssertionTypes::Context,
) => Ok(PositiveAssertionTypes::Boolean), ) => Ok(PositiveAssertionTypes::Boolean),
| ( | (
@ -513,7 +520,9 @@ impl PositiveUnary {
PositiveAssertionTypes::Context, PositiveAssertionTypes::Context,
) => Ok(PositiveAssertionTypes::Boolean), ) => Ok(PositiveAssertionTypes::Boolean),
| ( | (
Self::Qualifier(PositiveQualifier::Context(QualifierContext::IsSet)), Self::Qualifier(PositiveQualifier::Context(
QualifierContext::IsSet,
)),
PositiveAssertionTypes::Context, PositiveAssertionTypes::Context,
) => Ok(PositiveAssertionTypes::Boolean), ) => Ok(PositiveAssertionTypes::Boolean),
| ( | (
@ -541,7 +550,9 @@ impl PositiveUnary {
PositiveAssertionTypes::Context, PositiveAssertionTypes::Context,
) => Ok(PositiveAssertionTypes::Boolean), ) => Ok(PositiveAssertionTypes::Boolean),
| ( | (
Self::Qualifier(PositiveQualifier::Context(QualifierContext::GetSet)), Self::Qualifier(PositiveQualifier::Context(
QualifierContext::GetSet,
)),
PositiveAssertionTypes::Context, PositiveAssertionTypes::Context,
) => Ok(PositiveAssertionTypes::Set), ) => Ok(PositiveAssertionTypes::Set),
| ( | (
@ -1596,14 +1607,14 @@ where
} => vec![PositiveAssertReturnValue::Context( } => vec![PositiveAssertReturnValue::Context(
(*next_process).clone(), (*next_process).clone(),
)] )]
.into_iter(), .into_iter(),
| Guarded { | Guarded {
reaction: _, reaction: _,
next_process, next_process,
} => vec![PositiveAssertReturnValue::Context( } => vec![PositiveAssertReturnValue::Context(
(*next_process).clone(), (*next_process).clone(),
)] )]
.into_iter(), .into_iter(),
| WaitEntity { | WaitEntity {
repeat: _, repeat: _,
repeated_process, repeated_process,
@ -1611,19 +1622,27 @@ where
} => vec![PositiveAssertReturnValue::Context( } => vec![PositiveAssertReturnValue::Context(
(*repeated_process).clone(), (*repeated_process).clone(),
)] )]
.into_iter(), .into_iter(),
| Summation { children } => children | Summation { children } => children
.iter() .iter()
.map(|c| PositiveAssertReturnValue::Context((**c).clone())) .map(|c| {
PositiveAssertReturnValue::Context(
(**c).clone(),
)
})
.collect::<Vec<_>>() .collect::<Vec<_>>()
.into_iter(), .into_iter(),
| NondeterministicChoice { children } => children | NondeterministicChoice { children } => children
.iter() .iter()
.map(|c| PositiveAssertReturnValue::Context((**c).clone())) .map(|c| {
PositiveAssertReturnValue::Context(
(**c).clone(),
)
})
.collect::<Vec<_>>() .collect::<Vec<_>>()
.into_iter(), .into_iter(),
}) })
} },
| _ => Err(format!("{val:?} is not a set in for cycle.")), | _ => Err(format!("{val:?} is not a set in for cycle.")),
} }
}, },