From 93c99e65df98ea5cb0e2e25c50ad95d1d33fe0b6 Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Fri, 22 May 2020 19:43:03 -0400 Subject: [PATCH] Remove previous in-code TODO, add new TODO Signed-off-by: Alek Ratzloff --- src/compile/block.rs | 16 ---------------- src/compile/name.rs | 8 ++++++++ 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/compile/block.rs b/src/compile/block.rs index 913e5f9..a23c0b9 100644 --- a/src/compile/block.rs +++ b/src/compile/block.rs @@ -8,22 +8,6 @@ pub enum Block { Body(ir::Body), Blocks(Vec), } -/* - * 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 { fn to_ir(&self, ctx: &mut Ctx) -> Result; diff --git a/src/compile/name.rs b/src/compile/name.rs index 4fdbb3f..cd6e84c 100644 --- a/src/compile/name.rs +++ b/src/compile/name.rs @@ -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,