From 6fc64f470c130ff50088aeb64497ce0988f0f378 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Thu, 9 Feb 2017 12:07:17 -0500 Subject: [PATCH] nitc: ASTDump exposes color helpers Signed-off-by: Jean Privat --- src/parser/parser_nodes.nit | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/parser/parser_nodes.nit b/src/parser/parser_nodes.nit index 5073193..e96d7b6 100644 --- a/src/parser/parser_nodes.nit +++ b/src/parser/parser_nodes.nit @@ -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 -- 1.7.9.5