The peg package has a pretty printer. However, I can think of a few other useful ways to pretty-print a tree. It may be good to add a pretty printer package:
/*
text_eof
├──────┐
│ ├──COI["coi"]
│ ├──KOhA["do"]
│ └──DOhU_elidible["DOhU"]
└──────┐
├────────┐
│ ├──────KOhA["ma"]
│ ├──────CU_elidible["CU"]
│ └──────GOhA["mo"]
└──IAU_elidible["IAU"]
*/
prettyprint.Tree(...)
/*
([coi do DOhU] [{ma CU mo} IAU])
*/
prettyprint.Braces(...)
/* --- The current pretty printer --- */
prettyprint.Structs(...)
Basically, take the code from here: https://github.com/eaburns/johaus/blob/master/pretty/pretty.go.
The peg package has a pretty printer. However, I can think of a few other useful ways to pretty-print a tree. It may be good to add a pretty printer package:
Basically, take the code from here: https://github.com/eaburns/johaus/blob/master/pretty/pretty.go.