File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed
Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ use "std/unicode/utf8"
1717struct field {
1818 f: &ast::Field
1919 token: &token::Token
20- expr: []byte
20+ tag: []byte
2121}
2222
2323struct rowAlign {
@@ -28,8 +28,8 @@ struct rowAlign {
2828}
2929
3030struct formatter {
31- indentLen: int = 1
32- indentStr: str = "\t"
31+ indentLen: int
32+ indentStr: str
3333
3434 mut i: int
3535 mut buf: strings::Builder
@@ -47,6 +47,8 @@ impl formatter {
4747 mut fmt := new(formatter)
4848 fmt.ef = exprFormatter.new(fmt)
4949 fmt.tf = &typeFormatter{fmt: fmt}
50+ fmt.indentLen = 1
51+ fmt.indentStr = "\t"
5052 ret fmt
5153 }
5254
@@ -479,12 +481,12 @@ impl formatter {
479481 n := len(self.ubuf())
480482 self.formatType(f.f.Kind)
481483 typeMax -= len(self.ubuf()) - n
482- if len(f.expr ) != 0 {
484+ if len(f.tag ) != 0 {
483485 if typeMax > 0 {
484486 self.write(strings::Repeat(" ", typeMax))
485487 }
486- self.write(" = ")
487- self.buf.Write(f.expr )!
488+ self.write(" ")
489+ self.buf.Write(f.tag )!
488490 }
489491 }
490492
@@ -765,9 +767,9 @@ impl formatter {
765767 if row != -1 && decl.token.Row != self.row {
766768 break
767769 }
768- if decl.f.Default != nil {
769- self.formatExpr (decl.f.Default )
770- decl.expr = cloneBuf(self.ubuf()[n:])
770+ if decl.f.Tag != nil {
771+ self.write (decl.f.Tag.Kind )
772+ decl.tag = cloneBuf(self.ubuf()[n:])
771773 self.setBuf(self.ubuf()[:n])
772774 }
773775 if row != -1 && decl.token.Row != self.row {
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ static mut _W = new(bool, false) // Flag -w
2121
2222fn writeError(message: str) {
2323 os::Stderr().WriteStr(message)!
24- os::Stderr().WriteByte('\n' )!
24+ os::Stderr().WriteStr("\n" )!
2525}
2626
2727// Derived from the "std/jule/importer", stay up to date.
You can’t perform that action at this time.
0 commit comments