Skip to content

Commit 2a70935

Browse files
committed
cuecontext: revert support for CUE_EXPERIMENT
We are unsure about the right API for experiments as of yet and we probably have something better. Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I437cad0b8ff38a0af4ac41cbe8357c51a0373f71 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1217084 TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
1 parent fc4ca40 commit 2a70935

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

cue/cuecontext/cuecontext.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"cuelang.org/go/internal"
2323
"cuelang.org/go/internal/core/runtime"
2424
"cuelang.org/go/internal/cuedebug"
25-
"cuelang.org/go/internal/cueexperiment"
2625
"cuelang.org/go/internal/envflag"
2726

2827
_ "cuelang.org/go/pkg"
@@ -109,17 +108,3 @@ func CUE_DEBUG(s string) Option {
109108
r.SetDebugOptions(&c)
110109
}}
111110
}
112-
113-
// CUE_EXPERIMENT takes a string with the same contents as CUE_EXPERIMENT and
114-
// configures the context with the relevant debug options. It panics for unknown
115-
// or malformed options.
116-
func CUE_EXPERIMENT(s string) Option {
117-
var c cueexperiment.Config
118-
if err := envflag.Parse(&c, s); err != nil {
119-
panic(fmt.Errorf("cuecontext.CUE_DEBUG: %v", err))
120-
}
121-
122-
return Option{func(r *runtime.Runtime) {
123-
r.SetGlobalExperiments(&c)
124-
}}
125-
}

internal/core/runtime/runtime.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,11 @@ func (r *Runtime) SetDebugOptions(flags *cuedebug.Config) {
100100
}
101101

102102
// SetGlobalExperiments that apply to language evaluation.
103+
// It does not set the version.
103104
func (r *Runtime) SetGlobalExperiments(flags *cueexperiment.Config) {
104105
r.simplifyValidators = !flags.KeepValidators
105-
if flags.EvalV3 {
106-
r.SetVersion(internal.EvalV3)
107-
} else {
108-
r.SetVersion(internal.EvalV2)
109-
}
106+
// Do not set version as this is already set by NewWithSettings or
107+
// SetVersion.
110108
}
111109

112110
// IsInitialized reports whether the runtime has been initialized.

0 commit comments

Comments
 (0)