-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cty: Mark-aware cty.Walk and cty.Transform
These functions would previously panic if given marked values. Walk will now walk correctly into marked collections, reporting the marked collection to the callback and then reporting the elements with no special additional marking under the assumption that the callback will track its own parent mark state if it needs it. Transform and TransformWithTransformer will also both walk correctly into marked collections. By default they will preserve any marks on containers as they rebuild corresponding new containers, but the transformer's Exit method has the opportunity to modify the markings before returning if needed, which allows using the transform functions to systematically apply additional marks throughout a data structure.
- Loading branch information
1 parent
b9c7d6b
commit 5f5dfca
Showing
2 changed files
with
102 additions
and
61 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