From: Jean Privat Date: Thu, 9 Oct 2014 00:21:07 +0000 (-0400) Subject: compiler: implements method_finish (partially) X-Git-Tag: v0.6.10~37^2~2 X-Git-Url: http://nitlanguage.org compiler: implements method_finish (partially) Signed-off-by: Jean Privat --- diff --git a/src/compiler/abstract_compiler.nit b/src/compiler/abstract_compiler.nit index c98d54e..a6f6afa 100644 --- a/src/compiler/abstract_compiler.nit +++ b/src/compiler/abstract_compiler.nit @@ -2601,6 +2601,12 @@ redef class AForExpr v.compile_callsite(next_meth, [it]) v.add("\}") v.add("BREAK_{v.escapemark_name(escapemark)}: (void)0;") + + var method_finish = self.method_finish + if method_finish != null then + # TODO: Find a way to call this also in long escape (e.g. return) + v.compile_callsite(method_finish, [it]) + end end end diff --git a/src/rapid_type_analysis.nit b/src/rapid_type_analysis.nit index a6adfee..6ce94cb 100644 --- a/src/rapid_type_analysis.nit +++ b/src/rapid_type_analysis.nit @@ -675,6 +675,8 @@ redef class AForExpr abort end v.add_callsite(self.method_next) + var mf = self.method_finish + if mf != null then v.add_callsite(mf) end end