MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / Tokens

Function Tokens

pkg/sql/parser/scan.go:981–995  ·  view source on GitHub ↗

Tokens decomposes the input into lexical tokens.

(sql string)

Source from the content-addressed store, hash-verified

979
980// Tokens decomposes the input into lexical tokens.
981func Tokens(sql string) (tokens []TokenString, ok bool) {
982 s := makeScanner(sql)
983 for {
984 var lval sqlSymType
985 s.scan(&lval)
986 if lval.id == ERROR {
987 return nil, false
988 }
989 if lval.id == 0 {
990 break
991 }
992 tokens = append(tokens, TokenString{TokenID: lval.id, Str: lval.str})
993 }
994 return tokens, true
995}
996
997// TokenString is the unit value returned by Tokens.
998type TokenString struct {

Callers

nothing calls this directly

Calls 2

makeScannerFunction · 0.85
scanMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…