nitpretty: does not assert for location on catch_up
authorAlexandre Terrasa <alexandre@moz-code.org>
Thu, 8 Jan 2015 09:58:40 +0000 (10:58 +0100)
committerAlexandre Terrasa <alexandre@moz-code.org>
Tue, 13 Jan 2015 16:47:43 +0000 (17:47 +0100)
This simple fix avoid assert failed on catch_up.
Does a no-op if current_location is after the target location.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

src/pretty.nit

index 9225750..39d84ee 100644 (file)
@@ -172,7 +172,7 @@ class PrettyPrinterVisitor
                else
                        abort
                end
-               assert current_token.location <= token.location
+               if current_token.location > token.location then return
                while current_token != token do visit current_token
        end