pretty: handle multi-iterators
authorJean Privat <jean@pryen.org>
Wed, 7 Oct 2015 02:30:08 +0000 (22:30 -0400)
committerJean Privat <jean@pryen.org>
Wed, 7 Oct 2015 12:53:46 +0000 (08:53 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/pretty.nit

index d55e248..b6989a3 100644 (file)
@@ -1519,6 +1519,20 @@ redef class AForExpr
                v.visit n_kwfor
                v.adds
 
+               for n_group in n_groups do
+                       v.visit n_group
+                       if n_group != n_groups.last then v.add ", "
+
+               end
+
+               v.adds
+               v.visit n_kwdo
+               if can_inline then visit_loop_inline v else visit_loop_block v
+       end
+end
+
+redef class AForGroup
+       redef fun accept_pretty_printer(v) do
                for n_id in n_ids do
                        v.visit n_id
                        if n_id != n_ids.last then v.add ", "
@@ -1528,9 +1542,6 @@ redef class AForExpr
                v.consume "in"
                v.adds
                v.visit n_expr
-               v.adds
-               v.visit n_kwdo
-               if can_inline then visit_loop_inline v else visit_loop_block v
        end
 end