16 lines
248 B
Go
16 lines
248 B
Go
package vm
|
|
|
|
type Function struct {
|
|
Instructions []*Instruction
|
|
}
|
|
|
|
func (fnc *Function) Copy() *Function {
|
|
ret := &Function{}
|
|
|
|
for _, instr := range fnc.Instructions {
|
|
ret.Instructions = append(ret.Instructions, instr.Copy())
|
|
}
|
|
|
|
return ret
|
|
}
|