-
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/diff: drop last uses of cue.Value.Struct
It was still used as part of the public EditScript API; it always referenced struct fields or list elements by index, which is OK for lists, but not a great mechanism for structs. Lean into cue.Selector instead, which works well for structs (regular fields, optional fields, definitions, etc) as well as for lists via index selectors. This also means we can massively simplify the API surface, given that the selector for each side of an edit already describes which field or element is being edited, and it can be used to obtain the edited value on either side via cue.Value.LookupPath. Note that the simplified API surface exposes fields directly in EditScript and Edit rather than using getter methods. This seems perfectly fine given that this is an internal API which is only used by the diff printer in the same package. In fact, the printer did not bother to use the getter methods anyway. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I964bbbb97b55025d0e7c911207034f0fc39976a7 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1202111 Unity-Result: CUE porcuepine <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Roger Peppe <[email protected]>
- Loading branch information
Showing
2 changed files
with
51 additions
and
122 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