add skeleton for instruction constructors
This commit is contained in:
@@ -40,6 +40,9 @@ func TestInstructionProperties(t *testing.T) {
|
||||
if len(i.Forms) == 0 {
|
||||
t.Errorf("instruction %s has no forms", i.Opcode)
|
||||
}
|
||||
if len(i.Arities()) == 0 {
|
||||
t.Errorf("instruction %s has empty arities list", i.Opcode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,14 @@ type Form struct {
|
||||
ImplicitOperands []ImplicitOperand
|
||||
}
|
||||
|
||||
func (f Form) Signature() []string {
|
||||
s := make([]string, len(f.Operands))
|
||||
for i, op := range f.Operands {
|
||||
s[i] = op.Type
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
type Operand struct {
|
||||
Type string
|
||||
Action Action
|
||||
|
||||
Reference in New Issue
Block a user