parseOmniStatementNode parses ONE statement's text with the omni parser and returns its single top-level statement node. Unlike the dual-AST transition (where omni was best-effort behind the legacy gatekeeper), a parse failure is now a hard error: the omni parser is the only parser, so a statement i
(text string)
| 49 | // is now a hard error: the omni parser is the only parser, so a statement it |
| 50 | // rejects must fail the batch the way a legacy ANTLR syntax error did. |
| 51 | func parseOmniStatementNode(text string) (omniast.Node, error) { |
| 52 | file, err := parseSnowflakeAST(text) |
| 53 | if err != nil { |
| 54 | return nil, err |
| 55 | } |
| 56 | if file == nil || len(file.Stmts) == 0 { |
| 57 | return nil, errors.New("statement yielded no parse tree") |
| 58 | } |
| 59 | return file.Stmts[0], nil |
| 60 | } |
| 61 | |
| 62 | // convertOmniParseError converts an omni *parser.ParseError into the bare |
| 63 | // *base.SyntaxError shape the legacy ANTLR error listener produced (callers |
no test coverage detected