pretty: skip commas in ANodes
authorJean Privat <jean@pryen.org>
Fri, 24 Apr 2015 11:06:52 +0000 (18:06 +0700)
committerJean Privat <jean@pryen.org>
Mon, 4 May 2015 20:08:12 +0000 (16:08 -0400)
I do not know why and by who the comma is skipped but in some case it
is still here. So force its removal if any.

For instance

~~~nit
foo(a, [b])
~~~

caused some issue

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

src/pretty.nit

index 0dc4ffb..1bea99b 100644 (file)
@@ -292,6 +292,8 @@ redef class ANodes[E]
                for e in self do
                        var e_can_inline = v.can_inline(e)
 
+                       if v.current_token isa TComma then v.skip
+
                        if e != first then
                                if not e_can_inline then
                                        v.add ","