sq/libsq/ast/operator.go
Neil O'Toole 44d27207f8
#256: column-only queries (#257)
* Column-only queries
2023-06-17 19:28:11 -06:00

22 lines
561 B
Go

package ast
// OperatorNode is a leaf node in an expression representing an operator such as ">" or "==".
type OperatorNode struct {
baseNode
}
// String returns a log/debug-friendly representation.
func (n *OperatorNode) String() string {
return nodeString(n)
}
// isOperator returns true if the supplied string is a recognized operator, e.g. "!=" or ">".
func isOperator(text string) bool {
switch text {
case "-", "+", "~", "!", "||", "*", "/", "%", "<<", ">>", "&", "<", "<=", ">", ">=", "==", "!=", "&&":
return true
default:
return false
}
}