test asmtest with instruction list

This commit is contained in:
Michael McLoughlin
2018-11-24 14:20:04 -08:00
parent bec73ca7a1
commit 898d66c585
6 changed files with 37 additions and 23 deletions

View File

@@ -10,12 +10,12 @@ import (
)
type Interface interface {
Generate([]*inst.Instruction) ([]byte, error)
Generate([]inst.Instruction) ([]byte, error)
}
type Func func([]*inst.Instruction) ([]byte, error)
type Func func([]inst.Instruction) ([]byte, error)
func (f Func) Generate(is []*inst.Instruction) ([]byte, error) {
func (f Func) Generate(is []inst.Instruction) ([]byte, error) {
return f(is)
}
@@ -39,7 +39,7 @@ type Builder func(Config) Interface
// GoFmt formats Go code produced from the given generator.
func GoFmt(i Interface) Interface {
return Func(func(is []*inst.Instruction) ([]byte, error) {
return Func(func(is []inst.Instruction) ([]byte, error) {
b, err := i.Generate(is)
if err != nil {
return nil, err