MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / FirstLexicalToken

Function FirstLexicalToken

pkg/sql/scanner/scan.go:1180–1187  ·  view source on GitHub ↗

FirstLexicalToken returns the first lexical token. Returns 0 if there is no token.

(sql string)

Source from the content-addressed store, hash-verified

1178// FirstLexicalToken returns the first lexical token.
1179// Returns 0 if there is no token.
1180func FirstLexicalToken(sql string) (tok int) {
1181 var s SQLScanner
1182 var lval fakeSym
1183 s.Init(sql)
1184 s.Scan(&lval)
1185 id := lval.ID()
1186 return int(id)
1187}
1188
1189// fakeSym is a simplified symbol type for use by
1190// HasMultipleStatements.

Callers

nothing calls this directly

Calls 3

ScanMethod · 0.95
IDMethod · 0.95
InitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…