lib/loxxy/back_end/resolver.rb in loxxy-0.2.04 vs lib/loxxy/back_end/resolver.rb in loxxy-0.2.05

- old
+ new

@@ -86,21 +86,10 @@ end_scope end_scope if aClassStmt.superclass @current_class = previous_class end - def before_for_stmt(aForStmt) - before_block_stmt(aForStmt) - end - - def after_for_stmt(aForStmt, aVisitor) - aForStmt.test_expr&.accept(aVisitor) - aForStmt.body_stmt.accept(aVisitor) - aForStmt.update_expr&.accept(aVisitor) - after_block_stmt(aForStmt) - end - def after_if_stmt(anIfStmt, aVisitor) anIfStmt.then_stmt.accept(aVisitor) anIfStmt.else_stmt&.accept(aVisitor) end @@ -121,10 +110,10 @@ end end def after_while_stmt(aWhileStmt, aVisitor) aWhileStmt.body.accept(aVisitor) - aWhileStmt.condition.accept(aVisitor) + aWhileStmt.condition&.accept(aVisitor) end # A variable declaration adds a new variable to current scope def before_var_stmt(aVarStmt) declare(aVarStmt.name)