check path from expression node to leaf node has logicalBinaryOperator OR
(node *antlr.BaseParserRuleContext)
| 1945 | |
| 1946 | // check path from expression node to leaf node has logicalBinaryOperator OR |
| 1947 | func (v *ASTBuilder) hasORInPath(node *antlr.BaseParserRuleContext) tree.LogicalBinaryExpType { |
| 1948 | parent := node.GetParent() |
| 1949 | op := tree.NOOP |
| 1950 | for parent != nil { |
| 1951 | switch p := parent.(type) { |
| 1952 | case antlrgen.IExpressionContext: |
| 1953 | return op |
| 1954 | case *antlrgen.LogicalBinaryContext: |
| 1955 | if p.GetOperator() != nil && v.getLogicalBinaryOperator(p.GetOperator().GetTokenType()) == tree.OR { |
| 1956 | return tree.OR |
| 1957 | } |
| 1958 | op = tree.AND |
| 1959 | } |
| 1960 | parent = parent.GetParent() |
| 1961 | } |
| 1962 | return op |
| 1963 | } |
| 1964 | |
| 1965 | // Parse parses input sql |
| 1966 | func Parse(sql string, logger common.Logger) (aql *queryCom.AQLQuery, err error) { |
no test coverage detected