nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
81d1f6a
)
nitc: ASTDump exposes color helpers
author
Jean Privat
<jean@pryen.org>
Thu, 9 Feb 2017 17:07:17 +0000
(12:07 -0500)
committer
Jean 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
patch
|
blob
|
history
diff --git
a/src/parser/parser_nodes.nit
b/src/parser/parser_nodes.nit
index
5073193
..
e96d7b6
100644
(file)
--- 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