MCPcopy Index your code
hub / github.com/expr-lang/expr / memberNode

Function memberNode

test/gen/gen.go:206–219  ·  view source on GitHub ↗
(depth int)

Source from the content-addressed store, hash-verified

204}
205
206func memberNode(depth int) string {
207 dot := "."
208 if maybe() {
209 dot = "?."
210 }
211 prop := oneOf(list[fn]{
212 {func(_ int) string { return random(dict) }, 5},
213 {node, 1},
214 })(depth - 1)
215 if maybe() {
216 return fmt.Sprintf("%v%v%v", node(depth-1), dot, prop)
217 }
218 return fmt.Sprintf("%v%v[%v]", node(depth-1), dot, prop)
219}
220
221func unaryNode(depth int) string {
222 op := random([]string{"-", "!", "not"})

Callers

nothing calls this directly

Calls 5

maybeFunction · 0.85
oneOfFunction · 0.85
randomFunction · 0.85
nodeFunction · 0.85
SprintfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…