GetOmniNode extracts the omni AST node from a base.AST interface. Returns the node and true if it is an *OmniAST, nil and false otherwise.
(a base.AST)
| 110 | // GetOmniNode extracts the omni AST node from a base.AST interface. |
| 111 | // Returns the node and true if it is an *OmniAST, nil and false otherwise. |
| 112 | func GetOmniNode(a base.AST) (ast.Node, bool) { |
| 113 | if a == nil { |
| 114 | return nil, false |
| 115 | } |
| 116 | omniAST, ok := a.(*OmniAST) |
| 117 | if !ok { |
| 118 | return nil, false |
| 119 | } |
| 120 | return omniAST.Node, true |
| 121 | } |
| 122 | |
| 123 | // ByteOffsetToRunePosition converts a byte offset in sql to a 1-based |
| 124 | // line:column position, where column is measured in Unicode code points |
no outgoing calls