nitc: ASTDump exposes color helpers
authorJean Privat <jean@pryen.org>
Thu, 9 Feb 2017 17:07:17 +0000 (12:07 -0500)
committerJean Privat <jean@pryen.org>
Thu, 9 Feb 2017 17:07:17 +0000 (12:07 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

src/parser/parser_nodes.nit

index 5073193..e96d7b6 100644 (file)
@@ -18,6 +18,7 @@ module parser_nodes
 
 import location
 import ordered_tree
+private import console
 
 # Root of the AST class-hierarchy
 abstract class ANode
@@ -204,6 +205,12 @@ class ASTDump
        do
                return "{n.class_name} {n.dump_info(self)} @{n.location}"
        end
+
+       # `s` as yellow
+       fun yellow(s: String): String do return s.yellow
+
+       # `s` as red
+       fun red(s: String): String do return s.red
 end
 
 # A sequence of nodes