this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <mpvl@gmail.com>
Change-Id: I437cad0b8ff38a0af4ac41cbe8357c51a0373f71
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1217084
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>

+3 -20
-15
cue/cuecontext/cuecontext.go
··· 22 22 "cuelang.org/go/internal" 23 23 "cuelang.org/go/internal/core/runtime" 24 24 "cuelang.org/go/internal/cuedebug" 25 - "cuelang.org/go/internal/cueexperiment" 26 25 "cuelang.org/go/internal/envflag" 27 26 28 27 _ "cuelang.org/go/pkg" ··· 109 108 r.SetDebugOptions(&c) 110 109 }} 111 110 } 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 - }
+3 -5
internal/core/runtime/runtime.go
··· 100 100 } 101 101 102 102 // SetGlobalExperiments that apply to language evaluation. 103 + // It does not set the version. 103 104 func (r *Runtime) SetGlobalExperiments(flags *cueexperiment.Config) { 104 105 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. 110 108 } 111 109 112 110 // IsInitialized reports whether the runtime has been initialized.