You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
internal/core/adt: rewrite Environments for disjuncts
The Evaluator uses an Environment that is used
to resolve references within CUE expressions.
Each Environment points to a Vertex in which to
look up a reference at that level.
When a disjunction for a node is evaluated, the
node is "cloned" for each disjunct.
Environments that point to the "cloned" node
must be updated to point to the respective
disjunct. This is especially true for the
various disjuncts that are inserted.
This change adds this rewriting code.
Note that for conjuncts that were already
added, either the value will not change,
or the expression will be re-evalauted when
it is later unified with something else.
We nonetheless add some code for this as
this invariant may not hold if we apply
more aggressive structure sharing.
This code is marked with a TODO.
Issue #3829
Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: If5804ad37bae17f8015022404b6af254b0fc1026
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1212022
TryBot-Result: CUEcueckoo <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
Reviewed-by: Matthew Sackman <[email protected]>
0 commit comments