Remove previous in-code TODO, add new TODO

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-05-22 19:43:03 -04:00
parent c5e1dca7ac
commit 93c99e65df
2 changed files with 8 additions and 16 deletions

View File

@@ -8,22 +8,6 @@ pub enum Block {
Body(ir::Body),
Blocks(Vec<Block>),
}
/*
* Current problem:
* Visiting a TranslateAst would generally return the IR directly per-function. However, returning
* a different value type per Acceptor would make it impossible to have &dyn Acceptor refs, which
* is needed for visitor-based GC.
*
* Ideas:
* - Remove Visit::Out return value, and instead expect that the acceptor implementation to report
* anything new to its visitor. Visitors/acceptors that require returning an error should use
* TryVisit and TryAccept.
* - Doesn't play nicely with something that might want to return something else.
* - TranslateAst doesn't necessarily need to be a Visitor, except for the context
* - Can we just fake it with TryFrom?
* impl TryFrom<(&'_ mut Ctx, ast::Stmt)> for ir::Stmt { ... }
*
*/
trait ToIr<I> {
fn to_ir(&self, ctx: &mut Ctx) -> Result<I>;

View File

@@ -87,6 +87,14 @@ impl NameStack {
// CollectNames
////////////////////////////////////////////////////////////////////////////////
// TODO : redo visitor and accept (again) for CollectNames and CollectSyms
//
// Needs to be visitor-centric and not accept-centric
/// Collect local stack names and push them to the top layer of the name stack.
pub struct CollectNames<'c, 't> {
ctx: &'c mut Ctx,