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