Skip to content

Commit

Permalink
fix: revert & except change to HashName impls
Browse files Browse the repository at this point in the history
  • Loading branch information
huitseeker committed Aug 13, 2023
1 parent f4d8d88 commit f00af54
Showing 1 changed file with 35 additions and 15 deletions.
50 changes: 35 additions & 15 deletions src/hash_witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,38 @@ pub trait HashName {

impl HashName for ConsName {
fn index(&self) -> usize {
#[allow(clippy::match_same_arms)]
match self {
Self::NeverUsed => MAX_CONSES_PER_REDUCTION + 1,
Self::Expr => 0,
Self::ExprCdr | Self::UnevaledArgsCdr => 1,
Self::ExprCdr => 1,
Self::UnevaledArgsCdr => 1,
Self::ExprCadr => 2,
Self::ExprCddr | Self::UnopConsLike | Self::Lambda => 3,
Self::ExprCaadr | Self::Begin | Self::InnerBody | Self::ExtendedClosureEnv => 4,
Self::UnevaledArgs
| Self::ExprCaaadr
| Self::ExtendedRec
| Self::EnvToUse
| Self::Binding => 5,
Self::FunBody | Self::NewRecCadr => 6,
Self::NewRec | Self::ClosedEnv => 7,
Self::Env | Self::ExpandedInner0 => 8,
Self::FunExpanded | Self::Expanded | Self::EnvCar => 9,
Self::InnerLambda | Self::TheCons | Self::EnvCaar | Self::ExpandedInner => 10,
Self::ExprCddr => 3,
Self::UnopConsLike => 3,
Self::Lambda => 3,
Self::ExprCaadr => 4,
Self::Begin => 4,
Self::InnerBody => 4,
Self::ExtendedClosureEnv => 4,
Self::UnevaledArgs => 5,
Self::ExprCaaadr => 5,
Self::ExtendedRec => 5,
Self::EnvToUse => 5,
Self::Binding => 5,
Self::FunBody => 6,
Self::NewRecCadr => 6,
Self::NewRec => 7,
Self::ClosedEnv => 7,
Self::Env => 8,
Self::ExpandedInner0 => 8,
Self::FunExpanded => 9,
Self::Expanded => 9,
Self::EnvCar => 9,
Self::InnerLambda => 10,
Self::TheCons => 10,
Self::EnvCaar => 10,
Self::ExpandedInner => 10,
}
}
}
Expand All @@ -117,10 +132,15 @@ pub enum ContName {

impl HashName for ContName {
fn index(&self) -> usize {
#[allow(clippy::match_same_arms)]
match self {
Self::NeverUsed => MAX_CONTS_PER_REDUCTION + 1,
Self::ApplyContinuation | Self::Lookup => 0,
Self::NewerCont | Self::NewerCont2 | Self::LetLike | Self::MakeThunk => 1,
Self::ApplyContinuation => 0,
Self::Lookup => 0,
Self::NewerCont => 1,
Self::NewerCont2 => 1,
Self::LetLike => 1,
Self::MakeThunk => 1,
}
}
}
Expand Down

0 comments on commit f00af54

Please sign in to comment.