MCPcopy Create free account
hub / github.com/expr-lang/expr / unaryNode

Function unaryNode

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

Source from the content-addressed store, hash-verified

219}
220
221func unaryNode(depth int) string {
222 op := random([]string{"-", "!", "not"})
223 // Use a simple formatting to ensure valid unary expression syntax
224 if op == "not" {
225 return fmt.Sprintf("not %v", node(depth-1))
226 }
227 return fmt.Sprintf("%s%v", op, node(depth-1))
228}
229
230func binaryNode(depth int) string {
231 return fmt.Sprintf("%v %v %v", node(depth-1), random(operators), node(depth-1))

Callers

nothing calls this directly

Calls 3

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…