Remove previous in-code TODO, add new TODO
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -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>;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user