ParseFromModelTokens parses tokenizer output ([]models.TokenWithSpan) directly into an AST. This is the preferred entry point for parsing SQL. It accepts the output of the tokenizer directly without any conversion step. Span information is preserved throughout parsing and is available for error rep
(tokens []models.TokenWithSpan)
| 328 | // Issue #322: token_conversion.go has been removed; preprocessing is now a |
| 329 | // lightweight normalisation step that works entirely with models.TokenWithSpan. |
| 330 | func (p *Parser) ParseFromModelTokens(tokens []models.TokenWithSpan) (*ast.AST, error) { |
| 331 | preprocessed := preprocessTokens(tokens) |
| 332 | return p.parseTokens(preprocessed) |
| 333 | } |
| 334 | |
| 335 | // ParseFromModelTokensWithPositions is identical to ParseFromModelTokens. |
| 336 | // Position information is embedded in every models.TokenWithSpan. |