Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(175)

Unified Diff: src/cmd/gofmt/gofmt.go

Issue 2319041: code review 2319041: go ast/parser/printer: permit elision of composite lite... (Closed)
Patch Set: code review 2319041: go ast/parser/printer: permit elision of composite lite... Created 13 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/cmd/gofmt/doc.go ('k') | src/cmd/gofmt/simplify.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cmd/gofmt/gofmt.go
===================================================================
--- a/src/cmd/gofmt/gofmt.go
+++ b/src/cmd/gofmt/gofmt.go
@@ -24,6 +24,7 @@
list = flag.Bool("l", false, "list files whose formatting differs from gofmt's")
write = flag.Bool("w", false, "write result to (source) file instead of stdout")
rewriteRule = flag.String("r", "", "rewrite rule (e.g., 'α[β:len(α)] -> α[β:]')")
+ simplifyAST = flag.Bool("s", false, "simplify code")
// debugging support
comments = flag.Bool("comments", true, "print comments")
@@ -106,6 +107,10 @@
file = rewrite(file)
}
+ if *simplifyAST {
+ simplify(file)
+ }
+
var res bytes.Buffer
_, err = (&printer.Config{printerMode, *tabWidth, nil}).Fprint(&res, file)
if err != nil {
« no previous file with comments | « src/cmd/gofmt/doc.go ('k') | src/cmd/gofmt/simplify.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b