(node *ast.UnaryNode)
| 425 | } |
| 426 | |
| 427 | func (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 | |
| 447 | func (c *compiler) BinaryNode(node *ast.BinaryNode) { |
| 448 | switch node.Operator { |
no test coverage detected