syntax: add VariableContext::to_s
authorJean Privat <jean@pryen.org>
Mon, 22 Jun 2009 15:50:55 +0000 (11:50 -0400)
committerJean Privat <jean@pryen.org>
Wed, 24 Jun 2009 19:47:49 +0000 (15:47 -0400)
Used to debug.

Signed-off-by: Jean Privat <jean@pryen.org>

src/syntax/control_flow.nit

index 2eddf2c..f693eaa 100644 (file)
@@ -161,6 +161,18 @@ abstract class VariableContext
                        end
                end
        end
+
+       redef meth to_s
+       do
+               var s = new Buffer
+               s.append(node.locate)
+               for v in _all_variables do
+                       var t = stype(v)
+                       if t == null then continue
+                       s.append(" {v}:{t}")
+               end
+               return s.to_s
+       end
 end
 
 class RootVariableContext