Split packages

This commit is contained in:
Ian Gulliver
2021-11-18 19:35:24 -10:00
parent b1e27cce79
commit 8b502f940c
3 changed files with 6 additions and 5 deletions

22
asm/parse.go Normal file
View File

@@ -0,0 +1,22 @@
package asm
import "gopkg.in/yaml.v2"
type program struct {
Functions []function `yaml:"functions"`
}
type function []instruction
type instruction []string
func parse(src []byte) (*program, error) {
prog := &program{}
err := yaml.UnmarshalStrict(src, &prog)
if err != nil {
return nil, err
}
return prog, nil
}