fix color test

This commit is contained in:
Masaaki Goshima 2021-11-25 21:46:51 +09:00
parent 7e0bfb4f54
commit 48b67e9378
No known key found for this signature in database
GPG Key ID: 6A53785055537153
2 changed files with 5 additions and 3 deletions

View File

@ -413,6 +413,8 @@ func (c *StructCode) ToOpcode(ctx *compileContext) Opcodes {
Type: c.typ,
DisplayIdx: ctx.opcodeIndex,
Indent: ctx.indent,
Next: end,
End: end,
}
codes = append(codes, head, end)
end.PrevField = head
@ -750,9 +752,9 @@ func (c *InterfaceCode) ToOpcode(ctx *compileContext) Opcodes {
var code *Opcode
switch {
case c.isPtr:
code = newOpCode(ctx, OpInterfacePtr)
code = newOpCode(ctx.withType(c.typ), OpInterfacePtr)
default:
code = newOpCode(ctx, OpInterface)
code = newOpCode(ctx.withType(c.typ), OpInterface)
}
ctx.incIndex()
return Opcodes{code}

View File

@ -81,7 +81,7 @@ func (c *Opcode) IterNext() *Opcode {
func (c *Opcode) IsEnd() bool {
if c == nil {
return false
return true
}
return c.Op == OpEnd || c.Op == OpInterfaceEnd || c.Op == OpRecursiveEnd
}