Files
subcoding/vm/function.go

16 lines
248 B
Go
Raw Normal View History

2021-11-19 20:38:56 -10:00
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
}