-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/core/export: simplify dynamic labels
This is now possible because of the passed down evaluator. Note that most of it is actually left unimplemented as revealing a new field may cause other fields to be shadowed, which Sanatize doesn't seem to handle properly yet. Useful for Issue #867 Signed-off-by: Marcel van Lohuizen <mpvl@golang.org> Change-Id: Ibd0f2f75f006cdd6c4e3e3eda428a0166a10b31c Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/541463 Reviewed-by: Paul Jolly <paul@myitcv.io> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org> Unity-Result: CUEcueckoo <cueckoo@cuelang.org>
- Loading branch information
Showing
8 changed files
with
164 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
In this file we test cases where a newly created dynamic field | ||
ends up shadowing an existing field. | ||
|
||
-- in.cue -- | ||
y: "outer" | ||
a: { | ||
key: "y" | ||
X=(key): "inner" | ||
|
||
refs: { | ||
Z="y": 1 | ||
outer: y | ||
mid: X // TODO(unshadow) | ||
inner: Z // TODO(unshadow) | ||
|
||
} | ||
} | ||
-- out/definition -- | ||
y: "outer" | ||
a: { | ||
key: "y" | ||
X=(key): "inner" | ||
refs: { | ||
y: 1 | ||
outer: y | ||
mid: X | ||
inner: y | ||
} | ||
} | ||
-- out/doc -- | ||
[] | ||
[y] | ||
[a] | ||
[a key] | ||
[a refs] | ||
[a refs y] | ||
[a refs outer] | ||
[a refs mid] | ||
[a refs inner] | ||
[a y] | ||
-- out/value -- | ||
== Simplified | ||
{ | ||
y: "outer" | ||
a: { | ||
key: "y" | ||
y: "inner" | ||
refs: { | ||
y: 1 | ||
outer: "outer" | ||
mid: "inner" | ||
inner: 1 | ||
} | ||
} | ||
} | ||
== Raw | ||
{ | ||
y: "outer" | ||
a: { | ||
key: "y" | ||
y: "inner" | ||
refs: { | ||
y: 1 | ||
outer: "outer" | ||
mid: "inner" | ||
inner: 1 | ||
} | ||
} | ||
} | ||
== Final | ||
{ | ||
y: "outer" | ||
a: { | ||
key: "y" | ||
y: "inner" | ||
refs: { | ||
y: 1 | ||
outer: "outer" | ||
mid: "inner" | ||
inner: 1 | ||
} | ||
} | ||
} | ||
== All | ||
{ | ||
y: "outer" | ||
a: { | ||
key: "y" | ||
y: "inner" | ||
refs: { | ||
y: 1 | ||
outer: "outer" | ||
mid: "inner" | ||
inner: 1 | ||
} | ||
} | ||
} | ||
== Eval | ||
{ | ||
y: "outer" | ||
a: { | ||
key: "y" | ||
y: "inner" | ||
refs: { | ||
y: 1 | ||
outer: "outer" | ||
mid: "inner" | ||
inner: 1 | ||
} | ||
} | ||
} |