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

Function node

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

Source from the content-addressed store, hash-verified

138type fn func(depth int) string
139
140func node(depth int) string {
141 if depth <= 0 {
142 return oneOf(list[fn]{
143 {nilNode, 1},
144 {envNode, 1},
145 {floatNode, 1},
146 {integerNode, 1},
147 {stringNode, 1},
148 {booleanNode, 1},
149 {identifierNode, 10},
150 {pointerNode, 10},
151 })(depth - 1)
152 }
153 return oneOf(list[fn]{
154 {sequenceNode, 1},
155 {variableNode, 1},
156 {arrayNode, 10},
157 {mapNode, 10},
158 {identifierNode, 1000},
159 {memberNode, 1500},
160 {unaryNode, 100},
161 {binaryNode, 2000},
162 {callNode, 2000},
163 {pipeNode, 1000},
164 {builtinNode, 500},
165 {predicateNode, 1000},
166 {pointerNode, 500},
167 {sliceNode, 100},
168 {conditionalNode, 100},
169 })(depth - 1)
170}
171
172func nilNode(_ int) string {
173 return "nil"

Callers 15

mainFunction · 0.85
memberNodeFunction · 0.85
unaryNodeFunction · 0.85
binaryNodeFunction · 0.85
methodNodeFunction · 0.85
callNodeFunction · 0.85
pipeNodeFunction · 0.85
builtinNodeFunction · 0.85
predicateNodeFunction · 0.85
arrayNodeFunction · 0.85
mapNodeFunction · 0.85
sliceNodeFunction · 0.85

Calls 1

oneOfFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…