1
0
mirror of https://github.com/danog/blackfriday.git synced 2024-11-30 04:29:13 +01:00

Make Node satisfy the Stringer interface

It allows for printing AST dumps in external code
This commit is contained in:
Pierre Neidhardt 2016-07-01 13:24:44 +02:00
parent 3575453f08
commit 37ffc1c86a

View File

@ -310,6 +310,10 @@ func (nw *NodeWalker) resumeAt(node *Node, entering bool) (*Node, bool) {
return nw.next()
}
func (ast *Node) String() string {
return dumpString(ast)
}
func dump(ast *Node) {
fmt.Println(dumpString(ast))
}