Skip to content

Commit

Permalink
Finish removal of generic visitor
Browse files Browse the repository at this point in the history
  • Loading branch information
timsueberkrueb committed Apr 21, 2024
1 parent 93f26a8 commit 691142f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 111 deletions.
18 changes: 10 additions & 8 deletions lang/lifting/src/fv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,22 @@ impl FV for ust::Match {
}

impl FV for ust::Case {
fn visit_fv(&self, _v: &mut USTVisitor) {
let ust::Case { info: _, name: _, args: _, body: _ } = self;
fn visit_fv(&self, v: &mut USTVisitor) {
let ust::Case { info: _, name: _, args, body } = self;

//body.visit_fv(v);
// TODO: The visitor context must be extended somehow.
v.bind_iter(args.params.iter(), |v| {
body.visit_fv(v);
})
}
}

impl FV for ust::Motive {
fn visit_fv(&self, v: &mut USTVisitor) {
let ust::Motive { info: _, param, ret_typ } = self;

param.visit_fv(v);
ret_typ.visit_fv(v);

v.bind_single(param, |v| ret_typ.visit_fv(v))
}
}

Expand All @@ -123,9 +126,8 @@ impl<T: FV> FV for Rc<T> {

impl<T: FV> FV for Option<T> {
fn visit_fv(&self, v: &mut USTVisitor) {
match self {
None => {}
Some(x) => x.visit_fv(v),
if let Some(x) = self {
x.visit_fv(v)
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions lang/syntax/src/ctx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ mod levels;
mod map;
pub mod map_idx;
pub mod values;
mod visit;

pub use def::*;
pub use levels::*;
pub use map::*;
pub use visit::*;
101 changes: 0 additions & 101 deletions lang/syntax/src/ctx/visit.rs

This file was deleted.

0 comments on commit 691142f

Please sign in to comment.