Fix indent num

This commit is contained in:
Masaaki Goshima 2021-06-12 22:38:52 +09:00
parent 56e5d7a457
commit b972a9bab3
5 changed files with 10 additions and 5 deletions

View File

@ -484,7 +484,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
oldOffset := ptrOffset
ptrOffset += code.Jmp.CurLen * uintptrSize
oldBaseIndent := ctx.BaseIndent
ctx.BaseIndent += code.Indent
indentDiffFromTop := c.Indent - 1
ctx.BaseIndent += code.Indent - indentDiffFromTop
newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen
if curlen < newLen {

View File

@ -484,7 +484,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
oldOffset := ptrOffset
ptrOffset += code.Jmp.CurLen * uintptrSize
oldBaseIndent := ctx.BaseIndent
ctx.BaseIndent += code.Indent
indentDiffFromTop := c.Indent - 1
ctx.BaseIndent += code.Indent - indentDiffFromTop
newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen
if curlen < newLen {

View File

@ -484,7 +484,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
oldOffset := ptrOffset
ptrOffset += code.Jmp.CurLen * uintptrSize
oldBaseIndent := ctx.BaseIndent
ctx.BaseIndent += code.Indent
indentDiffFromTop := c.Indent - 1
ctx.BaseIndent += code.Indent - indentDiffFromTop
newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen
if curlen < newLen {

View File

@ -484,7 +484,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
oldOffset := ptrOffset
ptrOffset += code.Jmp.CurLen * uintptrSize
oldBaseIndent := ctx.BaseIndent
ctx.BaseIndent += code.Indent
indentDiffFromTop := c.Indent - 1
ctx.BaseIndent += code.Indent - indentDiffFromTop
newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen
if curlen < newLen {

View File

@ -484,7 +484,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
oldOffset := ptrOffset
ptrOffset += code.Jmp.CurLen * uintptrSize
oldBaseIndent := ctx.BaseIndent
ctx.BaseIndent += code.Indent
indentDiffFromTop := c.Indent - 1
ctx.BaseIndent += code.Indent - indentDiffFromTop
newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen
if curlen < newLen {