Add dumbindent algorithm comment

This commit is contained in:
Nigel Tao committed 2020-06-08 23:25:08 +10:00
1 parent e42d126667
commit 22d08366c8
3 files changed
+112 -32

No files matched your search

+6 -8
View File
@@ -95,26 +95,24 @@ func TestTabs(tt *testing.T) {
func ExampleFormatBytes() {
const src = `
// Blah blah blah.
for (i = 0; i < 3; i++) {
j = 0; j < 4; j++;
j = 0; j++; // Semi-colons not within parentheses.
if (i < j) { foo(); }
u = (v +
w);
}
`
os.Stdout.Write(FormatBytes(nil, []byte(src), nil))
// Output:
// // Blah blah blah.
//
// for (i = 0; i < 3; i++) {
// j = 0;
// j < 4;
// j++;
// j++; // Semi-colons not within parentheses.
// if (i < j) {
// foo();
// }
// u = (v +
// w);
// }
}