parameter loading

This commit is contained in:
Michael McLoughlin
2018-12-08 20:14:51 -08:00
parent bbbf6399a1
commit 69ee0e39cb
9 changed files with 355 additions and 61 deletions

View File

@@ -38,7 +38,7 @@ func (i Instruction) IsConditionalBranch() bool {
func (i Instruction) Arities() []int {
s := map[int]bool{}
for _, f := range i.Forms {
s[len(f.Operands)] = true
s[f.Arity()] = true
}
a := make([]int, 0, len(s))
for n := range s {
@@ -71,8 +71,12 @@ type Form struct {
ImplicitOperands []ImplicitOperand
}
func (f Form) Arity() int {
return len(f.Operands)
}
func (f Form) Signature() []string {
s := make([]string, len(f.Operands))
s := make([]string, f.Arity())
for i, op := range f.Operands {
s[i] = op.Type
}