File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import (
2727 "cuelang.org/go/cue/errors"
2828 "cuelang.org/go/cue/format"
2929 "cuelang.org/go/cue/token"
30+ "cuelang.org/go/internal"
3031)
3132
3233// A Runtime is used for creating CUE interpretations.
@@ -38,6 +39,12 @@ type Runtime struct {
3839 idx * index
3940}
4041
42+ func init () {
43+ internal .GetRuntime = func (instance interface {}) interface {} {
44+ return & Runtime {idx : instance .(* Instance ).index }
45+ }
46+ }
47+
4148func dummyLoad (token.Pos , string ) * build.Instance { return nil }
4249
4350func (r * Runtime ) index () * index {
Original file line number Diff line number Diff line change @@ -53,3 +53,6 @@ var DropOptional bool
5353
5454// UnifyBuiltin returns the given Value unified with the given builtin template.
5555var UnifyBuiltin func (v interface {}, kind string ) interface {}
56+
57+ // GetRuntime reports the runtime for an Instance.
58+ var GetRuntime func (instance interface {}) interface {}
You can’t perform that action at this time.
0 commit comments