String representation, helpful in logging.
()
| 34 | |
| 35 | // String representation, helpful in logging. |
| 36 | func (e *areaExpression) String() (res string) { |
| 37 | if e.obj != nil { |
| 38 | res = e.obj.String() |
| 39 | } else { |
| 40 | var chStrings []string |
| 41 | for _, c := range e.children { |
| 42 | chStrings = append(chStrings, c.String()) |
| 43 | } |
| 44 | switch e.op { |
| 45 | case NOOP: |
| 46 | res = "empty operator" |
| 47 | case AND: |
| 48 | res = "(" + strings.Join(chStrings, " "+tokenAND+" ") + ")" |
| 49 | case OR: |
| 50 | res = "(" + strings.Join(chStrings, " "+tokenOR+" ") + ")" |
| 51 | default: |
| 52 | res = "unknown operator" |
| 53 | } |
| 54 | } |
| 55 | if e.negate { |
| 56 | res = tokenNOT + " " + res |
| 57 | } |
| 58 | return |
| 59 | } |
| 60 | |
| 61 | // Return boolean value modulo negate field of the expression. |
| 62 | func (e *areaExpression) maybeNegate(val bool) bool { |
no outgoing calls
no test coverage detected