printer: use tabwriter to align instructions (#8)

This commit is contained in:
Michael McLoughlin
2019-01-10 21:21:41 -08:00
parent 0e253b3753
commit f77a2e3b9e
20 changed files with 1876 additions and 1821 deletions

View File

@@ -4,6 +4,7 @@ package prnt
import (
"bytes"
"fmt"
"io"
)
// Generator provides convenience methods for code generators. In particular it
@@ -15,6 +16,11 @@ type Generator struct {
err error
}
// Raw provides direct access to the underlying output stream.
func (g *Generator) Raw() io.Writer {
return &g.buf
}
// Printf prints to the internal buffer.
func (g *Generator) Printf(format string, args ...interface{}) {
if g.err != nil {