1
0

utils.go 886 B

123456789101112131415161718192021222324
  1. package rt2
  2. import (
  3. "fw/cp"
  4. "fw/cp/node"
  5. "fw/rt2/context"
  6. "fw/rt2/frame"
  7. "fw/rt2/nodeframe"
  8. "fw/rt2/scope"
  9. )
  10. var utils nodeframe.NodeFrameUtils
  11. //func DataOf(f frame.Frame) map[interface{}]interface{} { panic(100) }
  12. func RegOf(f frame.Frame) map[interface{}]interface{} { return utils.DataOf(f) }
  13. func ValueOf(f frame.Frame) map[cp.ID]scope.Value { return utils.ValueOf(f) }
  14. func NodeOf(f frame.Frame) node.Node { return utils.NodeOf(f) }
  15. func Push(f, p frame.Frame) { utils.Push(f, p) }
  16. func New(n node.Node) frame.Frame { return utils.New(n) }
  17. func ScopeOf(f frame.Frame) scope.Manager {
  18. return f.Domain().Discover(context.SCOPE).(scope.Manager)
  19. }
  20. func ReplaceDomain(f frame.Frame, d context.Domain) { utils.ReplaceDomain(f, d) }
  21. func Assert(f frame.Frame, ok frame.Assert) { utils.Assert(f, ok) }