Commit 0998eaf4 authored by Robert Griesemer's avatar Robert Griesemer

- correct error handling throughout

- documentation, cleanups
- more options

R=r
OCL=19736
CL=19736
parent bd6e0bc8
......@@ -15,8 +15,8 @@ import OS "os"
import TabWriter "tabwriter"
var (
usetabs = Flag.Bool("usetabs", false, nil, "align with tabs instead of blanks");
tabwidth = Flag.Int("tabwidth", 4, nil, "tab width");
usetabs = Flag.Bool("usetabs", false, nil, "align with tabs instead of blanks");
comments = Flag.Bool("comments", false, nil, "enable printing of comments");
)
......@@ -604,7 +604,7 @@ func (P *Printer) Declaration(d *AST.Decl, parenthesized bool) {
func (P *Printer) Program(p *AST.Program) {
// TODO should initialize all fields?
P.writer = TabWriter.MakeTabWriter(OS.Stdout, usetabs.BVal(), int(tabwidth.IVal()));
P.writer = TabWriter.New(OS.Stdout, int(tabwidth.IVal()), 1, usetabs.BVal());
P.clist = p.comments;
P.cindex = 0;
......
This diff is collapsed.
......@@ -14,8 +14,8 @@ import (
var (
usetabs = flag.Bool("usetabs", false, nil, "align with tabs instead of blanks");
tabwidth = flag.Int("tabwidth", 4, nil, "tab width");
usetabs = flag.Bool("usetabs", false, nil, "align with tabs instead of blanks");
)
......@@ -36,7 +36,7 @@ func Untab(name string, src *os.FD, dst *tabwriter.TabWriter) {
func main() {
flag.Parse();
dst := tabwriter.MakeTabWriter(os.Stdout, usetabs.BVal(), int(tabwidth.IVal()));
dst := tabwriter.New(os.Stdout, int(tabwidth.IVal()), 1, usetabs.BVal());
if flag.NArg() > 0 {
for i := 0; i < flag.NArg(); i++ {
name := flag.Arg(i);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment