Doc converts f (generally a Statement) to a pretty.Doc. If f does not have a native conversion, its .Format representation is used as a simple Text Doc.
(f NodeFormatter)
| 146 | // Doc converts f (generally a Statement) to a pretty.Doc. If f does not have a |
| 147 | // native conversion, its .Format representation is used as a simple Text Doc. |
| 148 | func (p *PrettyCfg) Doc(f NodeFormatter) pretty.Doc { |
| 149 | if f, ok := f.(docer); ok { |
| 150 | doc := f.doc(p) |
| 151 | return doc |
| 152 | } |
| 153 | return p.docAsString(f) |
| 154 | } |
| 155 | |
| 156 | func (p *PrettyCfg) docAsString(f NodeFormatter) pretty.Doc { |
| 157 | const prettyFlags = FmtShowPasswords | FmtParsable |
no test coverage detected