cargo fmt, additional operations for dsl on context

This commit is contained in:
elvis
2025-12-15 14:53:34 +01:00
parent ca6f6e7b39
commit bbd482e2ce
12 changed files with 7360 additions and 176 deletions

View File

@ -176,6 +176,31 @@ impl fmt::Debug for QualifierSystem {
}
}
impl fmt::Debug for QualifierContext {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
| Self::IsNill => write!(f, "isNill"),
| Self::IsIdentifier => write!(f, "isIdentifier"),
| Self::IsSet => write!(f, "isSet"),
| Self::IsGuarded => write!(f, "isGuarded"),
| Self::IsRepeated => write!(f, "isRepeated"),
| Self::IsSummation => write!(f, "isSummation"),
| Self::IsNondeterministicChoice =>
write!(f, "isNondeterministicChoice"),
| Self::GetIdentifier => write!(f, "getIdentifier"),
| Self::GetSet => write!(f, "getSet"),
| Self::GetGuardReactants => write!(f, "getGuardReactants"),
| Self::GetGuardInhibitors => write!(f, "getInhibitors"),
| Self::GetGuardProducts => write!(f, "getGuardProducts"),
| Self::GetRepeatedCounter => write!(f, "getRepeatedCounter"),
| Self::GetRepeatedProcess => write!(f, "getRepeatedProcess"),
| Self::GetNextProcesses => write!(f, "getNextProcesses"),
}
}
}
impl fmt::Debug for QualifierEdge {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
@ -201,6 +226,7 @@ impl fmt::Debug for Qualifier {
| Self::Label(q) => write!(f, "{q:?}"),
| Self::Restricted(q) => write!(f, "{q:?}"),
| Self::System(q) => write!(f, "{q:?}"),
| Self::Context(q) => write!(f, "{q:?}"),
| Self::Edge(q) => write!(f, "{q:?}"),
| Self::Node(q) => write!(f, "{q:?}"),
}
@ -250,6 +276,7 @@ impl fmt::Debug for AssertReturnValue {
},
| Self::System(sys) => write!(f, "{{debug: {sys:?}}}"),
| Self::Context(ctx) => write!(f, "{{debug: {ctx:?}}}"),
| Self::RangeContext(ctx) => write!(f, "{{debug: {ctx:?}}}"),
}
}
}
@ -269,6 +296,7 @@ impl fmt::Debug for AssertionTypes {
| Self::RangeInteger => write!(f, "range of integers"),
| Self::RangeSet => write!(f, "range of set"),
| Self::RangeNeighbours => write!(f, "range of edges"),
| Self::RangeContexts => write!(f, "range of contexts"),
| Self::Edge => write!(f, "edge"),
| Self::Node => write!(f, "node"),
}
@ -523,6 +551,16 @@ impl PrintableWithTranslator for QualifierSystem {
}
}
impl PrintableWithTranslator for QualifierContext {
fn print(
&self,
f: &mut fmt::Formatter,
_translator: &Translator,
) -> fmt::Result {
write!(f, "{self:?}")
}
}
impl PrintableWithTranslator for QualifierEdge {
fn print(
&self,
@ -557,6 +595,9 @@ impl PrintableWithTranslator for Qualifier {
| Self::System(q) => {
write!(f, "{}", Formatter::from(translator, q))
},
| Self::Context(q) => {
write!(f, "{}", Formatter::from(translator, q))
},
| Self::Edge(q) => write!(f, "{}", Formatter::from(translator, q)),
| Self::Node(q) => write!(f, "{}", Formatter::from(translator, q)),
}
@ -601,6 +642,13 @@ impl PrintableWithTranslator for AssertReturnValue {
| Self::Context(ctx) => {
write!(f, "{}", Formatter::from(translator, ctx))
},
| Self::RangeContext(ctx) => {
write!(
f,
"{{next processes of: {}}}",
Formatter::from(translator, ctx)
)
},
}
}
}