MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / ParseFromModelTokens

Method ParseFromModelTokens

pkg/sql/parser/parser.go:330–333  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

328// Issue #322: token_conversion.go has been removed; preprocessing is now a
329// lightweight normalisation step that works entirely with models.TokenWithSpan.
330func (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.

Callers 15

LintStringMethod · 0.95
makeCtxFunction · 0.95
makeCtxFunction · 0.95
makeContextFunction · 0.95
testSQLFileFunction · 0.95
parseSQLFunction · 0.95

Calls 2

parseTokensMethod · 0.95
preprocessTokensFunction · 0.85

Tested by 15

makeCtxFunction · 0.76
makeCtxFunction · 0.76
makeContextFunction · 0.76
testSQLFileFunction · 0.76
parseSQLFunction · 0.76