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

Method UnaryNode

compiler/compiler.go:427–445  ·  view source on GitHub ↗
(node *ast.UnaryNode)

Source from the content-addressed store, hash-verified

425}
426
427func (c *compiler) UnaryNode(node *ast.UnaryNode) {
428 c.compile(node.Node)
429 c.derefInNeeded(node.Node)
430
431 switch node.Operator {
432
433 case "!", "not":
434 c.emit(OpNot)
435
436 case "+":
437 // Do nothing
438
439 case "-":
440 c.emit(OpNegate)
441
442 default:
443 panic(fmt.Sprintf("unknown operator (%v)", node.Operator))
444 }
445}
446
447func (c *compiler) BinaryNode(node *ast.BinaryNode) {
448 switch node.Operator {

Callers 1

compileMethod · 0.95

Calls 4

compileMethod · 0.95
derefInNeededMethod · 0.95
emitMethod · 0.95
SprintfMethod · 0.80

Tested by

no test coverage detected