Skip to content

Commit

Permalink
Merge branch 'sort-endofunctor' into determinize-after-each-combinator
Browse files Browse the repository at this point in the history
  • Loading branch information
wrsturgeon committed Nov 3, 2023
2 parents 75dda4f + 4426988 commit b79ac71
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 5 additions & 4 deletions src/fixpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use inator_automata::*;
pub struct Fixpoint(String);

impl<I: Input, S: Stack, C: Ctrl<I, S>> ops::Shr<Graph<I, S, C>> for Fixpoint {
type Output = Nondeterministic<I, S>;
type Output = Graph<I, S, C>;
#[inline]
#[allow(clippy::manual_assert, clippy::panic)]
fn shr(self, rhs: Graph<I, S, C>) -> Self::Output {
Expand Down Expand Up @@ -44,12 +44,13 @@ impl<I: Input, S: Stack, C: Ctrl<I, S>> ops::Shr<Graph<I, S, C>> for Fixpoint {
if tags.insert(self.0, init_set).is_some() {
panic!("Fixpoint name already in use");
}
Graph {
let mut out = Graph {
states,
initial,
tags,
}
.sort()
};
out.sort();
out
}
}

Expand Down
7 changes: 4 additions & 3 deletions src/recurse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl<I: Input, S: Stack, C: Ctrl<I, S>> ops::Shr<Recurse> for Graph<I, S, C> {
.filter(|&(_, v)| v.iter().any(|i| accepting_indices.contains(i)))
.map(|(k, _)| k.clone())
.collect();
Graph {
let mut out = Graph {
states: self
.states
.into_iter()
Expand All @@ -61,8 +61,9 @@ impl<I: Input, S: Stack, C: Ctrl<I, S>> ops::Shr<Recurse> for Graph<I, S, C> {
.map(|r| r.map_err(str::to_owned))
.collect(),
tags: self.tags,
}
.sort()
};
out.sort();
out
}
}

Expand Down

0 comments on commit b79ac71

Please sign in to comment.