alias.go 360 B

1234567891011121314151617181920
  1. package muesli
  2. func (vm *VM) AliasUp(from, to string, level int) Value {
  3. value := vm.Lookup(to)
  4. if value == nil {
  5. return value
  6. }
  7. return vm.RegisterUp(from, value, level)
  8. }
  9. func (vm *VM) Alias(from, to string) Value {
  10. value := vm.Lookup(to)
  11. if value == nil {
  12. return value
  13. }
  14. return vm.Register(from, value)
  15. }