this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/core: comment improvements

Fix a couple of typos in the `OpContext` doc comment.
Mention possible implementations of `StringIndexer` in `core/debug`.

Change-Id: I6be27b2b7868493301d8444dd261de9d6ae577fa
Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/537208
Reviewed-by: Marcel van Lohuizen <mpvl@gmail.com>
Unity-Result: CUEcueckoo <cueckoo@cuelang.org>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>

authored by

Roger Peppe and committed by
Daniel Martí
34782fe0 618e5301

+8 -4
+3 -4
internal/core/adt/context.go
··· 190 190 return ctx 191 191 } 192 192 193 - // An OpContext implements CUE's unification operation. It's operations only 194 - // operation on values that are created with the Runtime with which an OpContext 195 - // is associated. An OpContext is not goroutine save and only one goroutine may 193 + // An OpContext implements CUE's unification operation. It only 194 + // operates on values that are created with the Runtime with which an OpContext 195 + // is associated. An OpContext is not goroutine safe and only one goroutine may 196 196 // use an OpContext at a time. 197 - // 198 197 type OpContext struct { 199 198 Runtime 200 199 Format func(Node) string
+5
internal/core/debug/debug.go
··· 43 43 Raw bool 44 44 } 45 45 46 + // WriteNode writes a string representation of the node to w. 46 47 func WriteNode(w io.Writer, i adt.StringIndexer, n adt.Node, config *Config) { 47 48 if config == nil { 48 49 config = &Config{} ··· 56 57 } 57 58 } 58 59 60 + // NodeString returns a string representation of the given node. 61 + // The StringIndexer value i is used to translate elements of n to strings. 62 + // Commonly available implementations of StringIndexer include *adt.OpContext 63 + // and *runtime.Runtime. 59 64 func NodeString(i adt.StringIndexer, n adt.Node, config *Config) string { 60 65 b := &strings.Builder{} 61 66 WriteNode(b, i, n, config)