Skip to content

Commit

Permalink
remove outdated TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
sezna committed Jun 29, 2024
1 parent 534289d commit 16cbd8d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
4 changes: 3 additions & 1 deletion petr-bind/src/binder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,9 @@ impl Binder {
petr_ast::AstNode::ImportStatement(stmt) => stmt.bind(binder),
});
let exports = BTreeMap::from_iter(exports);
// TODO do I need to track this module id?
// we don't need to track this module ID -- it just needs to exist,
// and all modules are iterated over in later stages of the compiler.
// So we can safely ignore the return value here.
let _module_id = binder.modules.insert(Module {
root_scope: scope_id,
exports,
Expand Down
21 changes: 8 additions & 13 deletions petr-bind/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,14 @@ impl Bind for Expression {
bindings,
expression,
expr_id,
}) => {
binder.with_scope(ScopeKind::ExpressionWithBindings, |binder, scope_id| {
for binding in bindings.iter() {
let binding_id = binder.insert_binding(binding.clone());
binder.insert_into_current_scope(binding.name.id, Item::Binding(binding_id));
}
// TODO: functions get inserted as Items with scopes, so we should probably
// insert bound expressions as an Item with their own scope, not sure how yet.
expression.bind(binder);
binder.insert_expression(*expr_id, scope_id);
//
})
},
}) => binder.with_scope(ScopeKind::ExpressionWithBindings, |binder, scope_id| {
for binding in bindings.iter() {
let binding_id = binder.insert_binding(binding.clone());
binder.insert_into_current_scope(binding.name.id, Item::Binding(binding_id));
}
expression.bind(binder);
binder.insert_expression(*expr_id, scope_id);
}),
_ => (),
}
}
Expand Down

0 comments on commit 16cbd8d

Please sign in to comment.