forked from mirror/go-json
fix color test
This commit is contained in:
parent
7e0bfb4f54
commit
48b67e9378
|
@ -413,6 +413,8 @@ func (c *StructCode) ToOpcode(ctx *compileContext) Opcodes {
|
||||||
Type: c.typ,
|
Type: c.typ,
|
||||||
DisplayIdx: ctx.opcodeIndex,
|
DisplayIdx: ctx.opcodeIndex,
|
||||||
Indent: ctx.indent,
|
Indent: ctx.indent,
|
||||||
|
Next: end,
|
||||||
|
End: end,
|
||||||
}
|
}
|
||||||
codes = append(codes, head, end)
|
codes = append(codes, head, end)
|
||||||
end.PrevField = head
|
end.PrevField = head
|
||||||
|
@ -750,9 +752,9 @@ func (c *InterfaceCode) ToOpcode(ctx *compileContext) Opcodes {
|
||||||
var code *Opcode
|
var code *Opcode
|
||||||
switch {
|
switch {
|
||||||
case c.isPtr:
|
case c.isPtr:
|
||||||
code = newOpCode(ctx, OpInterfacePtr)
|
code = newOpCode(ctx.withType(c.typ), OpInterfacePtr)
|
||||||
default:
|
default:
|
||||||
code = newOpCode(ctx, OpInterface)
|
code = newOpCode(ctx.withType(c.typ), OpInterface)
|
||||||
}
|
}
|
||||||
ctx.incIndex()
|
ctx.incIndex()
|
||||||
return Opcodes{code}
|
return Opcodes{code}
|
||||||
|
|
|
@ -81,7 +81,7 @@ func (c *Opcode) IterNext() *Opcode {
|
||||||
|
|
||||||
func (c *Opcode) IsEnd() bool {
|
func (c *Opcode) IsEnd() bool {
|
||||||
if c == nil {
|
if c == nil {
|
||||||
return false
|
return true
|
||||||
}
|
}
|
||||||
return c.Op == OpEnd || c.Op == OpInterfaceEnd || c.Op == OpRecursiveEnd
|
return c.Op == OpEnd || c.Op == OpInterfaceEnd || c.Op == OpRecursiveEnd
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue