Skip to content

Commit

Permalink
internal/core/adt: more shallow evaluation of lists
Browse files Browse the repository at this point in the history
This is needed to pass various tests.

Bugs still remains, but the main point is that it
unblocks a next phase in structure sharing.

Issue #2854
Issue #2850
Issue #3165
Fixes #3410
Fixes #3420
Issue #3443

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: Ibd2a41e25e07bd37899620af6bd9665435d68e8a
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1202212
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Matthew Sackman <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
  • Loading branch information
mpvl committed Oct 8, 2024
1 parent 86fdd97 commit 2d4a895
Show file tree
Hide file tree
Showing 20 changed files with 1,153 additions and 1,289 deletions.
78 changes: 0 additions & 78 deletions cue/testdata/builtins/all.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -34,84 +34,6 @@ Retain: 3
Unifications: 20
Conjuncts: 27
Disjuncts: 21
-- out/evalalpha --
Errors:
fatalArg.x: invalid operands "eee" and 'eee' to '+' (type string and bytes):
./in.cue:2:9
./in.cue:2:17
fatalChild.0.a: undefined field: c:
./in.cue:8:17

Result:
(_|_){
// [eval]
fatalArg: (_|_){
// [eval]
x: (_|_){
// [eval] fatalArg.x: invalid operands "eee" and 'eee' to '+' (type string and bytes):
// ./in.cue:2:9
// ./in.cue:2:17
}
}
fatalChild: (_|_){
// [eval]
#b: (#struct){
}
x: (_|_){
// [eval] fatalChild.0.a: undefined field: c:
// ./in.cue:8:17
}
}
okIncompleteChild: (struct){
b: (struct){
}
x: (struct){
a: (_|_){
// [incomplete] okIncompleteChild.x.a: undefined field: c:
// ./in.cue:16:16
}
b: (int){ 1 }
}
}
andInPattern: (struct){
out: (struct){
someKey: (struct){
}
}
#constraints: (#list){
0: (string){ =~"^.*$" }
}
}
}
-- diff/-out/evalalpha<==>+out/eval --
diff old new
--- old
+++ new
@@ -2,7 +2,7 @@
fatalArg.x: invalid operands "eee" and 'eee' to '+' (type string and bytes):
./in.cue:2:9
./in.cue:2:17
-fatalChild.x.a: undefined field: c:
+fatalChild.0.a: undefined field: c:
./in.cue:8:17

Result:
@@ -21,11 +21,8 @@
#b: (#struct){
}
x: (_|_){
- // [eval]
- a: (_|_){
- // [eval] fatalChild.x.a: undefined field: c:
- // ./in.cue:8:17
- }
+ // [eval] fatalChild.0.a: undefined field: c:
+ // ./in.cue:8:17
}
}
okIncompleteChild: (struct){
-- diff/todo/p2 --
Path of old and new error is incorrect.
-- out/eval --
Errors:
fatalArg.x: invalid operands "eee" and 'eee' to '+' (type string and bytes):
Expand Down
Loading

0 comments on commit 2d4a895

Please sign in to comment.