Add {cmd,lib}/dumbindent

This commit is contained in:
Nigel Tao committed 2020-06-04 23:35:11 +10:00
1 parent b2dc84105a
commit d8cd72798a
3 files changed
+408

No files matched your search

+3
View File
@@ -30,6 +30,7 @@ import (
"github.com/google/wuffs/lang/builtin"
"github.com/google/wuffs/lang/generate"
"github.com/google/wuffs/lib/dumbindent"
cf "github.com/google/wuffs/cmd/commonflags"
@@ -200,6 +201,8 @@ func Do(args []string) error {
// C code, so further C formatting is unnecessary (and not costless).
if (*cformatterFlag == "") || (pkgName == "base") {
return unformatted, nil
} else if *cformatterFlag == "dumbindent" {
return dumbindent.Format(unformatted)
}
stdout := &bytes.Buffer{}