Skip to content

Commit

Permalink
feat(lura-hir): remove debruijin indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
aripiprazole committed Nov 13, 2023
1 parent c2d1f0a commit d6502ac
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lura-hir/src/debruijin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ pub struct Level(pub usize);

impl Level {
/// Transforms a level into a debruijin index.
pub fn as_idx(&self, Level(x): Level) -> Index {
let Level(l) = *self;
assert!(l > x, "l > x, but {l} < {x}");
assert!(l > 0, "l should be greater than 0");

Index(l - x - 1)
pub fn as_idx(&self, Level(_): Level) -> Index {
let Level(_) = *self;
// assert!(l > x, "expected l > x, but {l} < {x}");
// assert!(l > 0, "l should be greater than 0");
// TODO
Index(0)
}
}

Expand Down

0 comments on commit d6502ac

Please sign in to comment.