mirror of https://github.com/antonmedv/fx
Parse in engine
parent
1bb2803186
commit
8ca74b870d
@ -0,0 +1,30 @@
|
||||
package jsonx
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func (n *Node) String() string {
|
||||
var out strings.Builder
|
||||
|
||||
it := n
|
||||
for it != nil {
|
||||
if it.Key != nil {
|
||||
out.Write(it.Key)
|
||||
out.WriteByte(':')
|
||||
}
|
||||
if it.Value != nil {
|
||||
out.Write(it.Value)
|
||||
}
|
||||
if it.Comma {
|
||||
out.WriteByte(',')
|
||||
}
|
||||
if it.IsCollapsed() {
|
||||
it = it.Collapsed
|
||||
} else {
|
||||
it = it.Next
|
||||
}
|
||||
}
|
||||
|
||||
return out.String()
|
||||
}
|
Loading…
Reference in New Issue