-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/core/adt: do not delay processing of fields
This causes tests to be reordered. The main problem was that if an embedding is processed before all fields are known, it might be marked inadvertently as incomplete. This is a preperatory CL that happens to fix two Issues. It removes some variability in processing order by converting conjuncts of the form `x: a&b` to fields of the form `x: a, x: b`. This has the unfortunate consequence that it misses some position information. The intention is to bring this back in the new implementation. The main contribution here is that conjunct processing is now reentrant: when a node is recursively evaluated, computation now resumes where it was. This avoids some conjuncts being missed and others from being processed double. Test changes: There are various reorderings. Processing times should roughly be the same, and at least not grow a lot for all files. This fixes a bug that caused changes in cmd_cycle.txtar: it would correctly detect that the schema is incorrect. Changes are made to keep the spirit of the test intact. This causes some failures to be undetected for the self-reference tests. This is okay, as an error only needs to be reported in one field. Ideally this is fixed again, though. chain.txtar is now creating a smaller output, which I believe is correct. closedness.txtar: the failure is now correctly propagated up. conjuncts.txtar: note that the conjunct.t3 test is still broken. This is not reflected in any issue. We leave it for now, but it should be fixed with the new evaluator. let.txtar: let now reports an error. Technically not correct, but not harmful. Fixes #2351 Fixes #2355 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: Ib6c50a38910f9a6029957676dcd56328691d0252 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/556545 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
- Loading branch information
Showing
99 changed files
with
686 additions
and
742 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,4 +69,4 @@ hello | |
|
||
command: hello1: task: hello: cli.Print & { | ||
text: "hello, world" | ||
} | ||
} |
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,15 @@ | ||
exec cue cmd gen | ||
|
||
-- task_tool.cue -- | ||
package ci | ||
|
||
command: gen: { | ||
$id: "tool/cli.Print" | ||
text: { | ||
#early: *"X" | string | ||
#early | ||
} & {// NEEDED | ||
#early: *"X" | string | ||
string | ||
} | ||
} |
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 |
---|---|---|
|
@@ -57,7 +57,7 @@ Allocs: 4 | |
Retain: 3 | ||
|
||
Unifications: 6 | ||
Conjuncts: 8 | ||
Conjuncts: 6 | ||
Disjuncts: 8 | ||
-- out/eval -- | ||
(struct){ | ||
|
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
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 |
---|---|---|
|
@@ -15,7 +15,7 @@ Allocs: 4 | |
Retain: 2 | ||
|
||
Unifications: 5 | ||
Conjuncts: 8 | ||
Conjuncts: 7 | ||
Disjuncts: 5 | ||
-- out/eval -- | ||
(struct){ | ||
|
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
Oops, something went wrong.