-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/astinternal: simpler internal API
As suggested in a too-tardy review here (https://review.gerrithub.io/c/cue-lang/cue/+/1200204) the explicit append API is kinda verbose and the undo logic is hard to follow. By putting the buffer into the debugPrinter type, everything becomes a bit cleaner. We also make share the same wrapping logic between slices and structs, making the commonality clearer. While we're about it, deal with nil interfaces and nil concrete types in the same place, making the logic a little simpler again. Signed-off-by: Roger Peppe <[email protected]> Change-Id: Iba81a933754eef172b59c6f71b535cf21948afd1 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1200225 TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
- Loading branch information
Showing
1 changed file
with
107 additions
and
97 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