MCPcopy
hub / github.com/expr-lang/expr / ConditionalNode

Method ConditionalNode

compiler/compiler.go:1276–1290  ·  view source on GitHub ↗
(node *ast.ConditionalNode)

Source from the content-addressed store, hash-verified

1274}
1275
1276func (c *compiler) ConditionalNode(node *ast.ConditionalNode) {
1277 c.compile(node.Cond)
1278 c.derefInNeeded(node.Cond)
1279 otherwise := c.emit(OpJumpIfFalse, placeholder)
1280
1281 c.emit(OpPop)
1282 c.compile(node.Exp1)
1283 end := c.emit(OpJump, placeholder)
1284
1285 c.patchJump(otherwise)
1286 c.emit(OpPop)
1287 c.compile(node.Exp2)
1288
1289 c.patchJump(end)
1290}
1291
1292func (c *compiler) ArrayNode(node *ast.ArrayNode) {
1293 for _, node := range node.Nodes {

Callers 1

compileMethod · 0.95

Calls 4

compileMethod · 0.95
derefInNeededMethod · 0.95
emitMethod · 0.95
patchJumpMethod · 0.95

Tested by

no test coverage detected