mirror of https://github.com/goccy/go-json.git
Fix indent num
This commit is contained in:
parent
56e5d7a457
commit
b972a9bab3
|
@ -484,7 +484,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
|
||||||
oldOffset := ptrOffset
|
oldOffset := ptrOffset
|
||||||
ptrOffset += code.Jmp.CurLen * uintptrSize
|
ptrOffset += code.Jmp.CurLen * uintptrSize
|
||||||
oldBaseIndent := ctx.BaseIndent
|
oldBaseIndent := ctx.BaseIndent
|
||||||
ctx.BaseIndent += code.Indent
|
indentDiffFromTop := c.Indent - 1
|
||||||
|
ctx.BaseIndent += code.Indent - indentDiffFromTop
|
||||||
|
|
||||||
newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen
|
newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen
|
||||||
if curlen < newLen {
|
if curlen < newLen {
|
||||||
|
|
|
@ -484,7 +484,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
|
||||||
oldOffset := ptrOffset
|
oldOffset := ptrOffset
|
||||||
ptrOffset += code.Jmp.CurLen * uintptrSize
|
ptrOffset += code.Jmp.CurLen * uintptrSize
|
||||||
oldBaseIndent := ctx.BaseIndent
|
oldBaseIndent := ctx.BaseIndent
|
||||||
ctx.BaseIndent += code.Indent
|
indentDiffFromTop := c.Indent - 1
|
||||||
|
ctx.BaseIndent += code.Indent - indentDiffFromTop
|
||||||
|
|
||||||
newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen
|
newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen
|
||||||
if curlen < newLen {
|
if curlen < newLen {
|
||||||
|
|
|
@ -484,7 +484,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
|
||||||
oldOffset := ptrOffset
|
oldOffset := ptrOffset
|
||||||
ptrOffset += code.Jmp.CurLen * uintptrSize
|
ptrOffset += code.Jmp.CurLen * uintptrSize
|
||||||
oldBaseIndent := ctx.BaseIndent
|
oldBaseIndent := ctx.BaseIndent
|
||||||
ctx.BaseIndent += code.Indent
|
indentDiffFromTop := c.Indent - 1
|
||||||
|
ctx.BaseIndent += code.Indent - indentDiffFromTop
|
||||||
|
|
||||||
newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen
|
newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen
|
||||||
if curlen < newLen {
|
if curlen < newLen {
|
||||||
|
|
|
@ -484,7 +484,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
|
||||||
oldOffset := ptrOffset
|
oldOffset := ptrOffset
|
||||||
ptrOffset += code.Jmp.CurLen * uintptrSize
|
ptrOffset += code.Jmp.CurLen * uintptrSize
|
||||||
oldBaseIndent := ctx.BaseIndent
|
oldBaseIndent := ctx.BaseIndent
|
||||||
ctx.BaseIndent += code.Indent
|
indentDiffFromTop := c.Indent - 1
|
||||||
|
ctx.BaseIndent += code.Indent - indentDiffFromTop
|
||||||
|
|
||||||
newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen
|
newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen
|
||||||
if curlen < newLen {
|
if curlen < newLen {
|
||||||
|
|
|
@ -484,7 +484,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
|
||||||
oldOffset := ptrOffset
|
oldOffset := ptrOffset
|
||||||
ptrOffset += code.Jmp.CurLen * uintptrSize
|
ptrOffset += code.Jmp.CurLen * uintptrSize
|
||||||
oldBaseIndent := ctx.BaseIndent
|
oldBaseIndent := ctx.BaseIndent
|
||||||
ctx.BaseIndent += code.Indent
|
indentDiffFromTop := c.Indent - 1
|
||||||
|
ctx.BaseIndent += code.Indent - indentDiffFromTop
|
||||||
|
|
||||||
newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen
|
newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen
|
||||||
if curlen < newLen {
|
if curlen < newLen {
|
||||||
|
|
Loading…
Reference in New Issue