MCPcopy Create free account
hub / github.com/brimdata/super / binary

Method binary

compiler/semantic/checker.go:429–448  ·  view source on GitHub ↗
(op string, loc, lloc, rloc ast.Node, lhs, rhs super.Type)

Source from the content-addressed store, hash-verified

427}
428
429func (c *checker) binary(op string, loc, lloc, rloc ast.Node, lhs, rhs super.Type) super.Type {
430 switch strings.ToLower(op) {
431 case "and", "or":
432 c.logical(lloc, rloc, lhs, rhs)
433 return super.TypeBool
434 case "in", "not in":
435 c.in(loc, lloc, rloc, lhs, rhs)
436 return super.TypeBool
437 case "==", "!=", "=", "<>":
438 return c.equality(lhs, rhs)
439 case "<", "<=", ">", ">=":
440 return c.comparison(lhs, rhs)
441 case "+":
442 return c.plus(loc, lhs, rhs)
443 case "-", "*", "/", "%":
444 return c.arithmetic(lloc, rloc, lhs, rhs)
445 default:
446 panic(op)
447 }
448}
449
450func (c *checker) this(loc ast.Node, this *sem.ThisExpr, typ super.Type) super.Type {
451 for _, field := range this.Path {

Callers 2

exprMethod · 0.95
binaryExprMethod · 0.45

Calls 6

logicalMethod · 0.95
inMethod · 0.95
equalityMethod · 0.95
comparisonMethod · 0.95
plusMethod · 0.95
arithmeticMethod · 0.95

Tested by

no test coverage detected