MCPcopy Create free account
hub / github.com/dolthub/doltgresql / LastLexicalToken

Function LastLexicalToken

postgres/parser/parser/scan.go:1061–1071  ·  view source on GitHub ↗

LastLexicalToken returns the last lexical token. If the string has no lexical tokens, returns 0 and ok=false.

(sql string)

Source from the content-addressed store, hash-verified

1059// LastLexicalToken returns the last lexical token. If the string has no lexical
1060// tokens, returns 0 and ok=false.
1061func LastLexicalToken(sql string) (lastTok int, ok bool) {
1062 s := makeScanner(sql)
1063 var lval sqlSymType
1064 for {
1065 last := lval.id
1066 s.scan(&lval)
1067 if lval.id == 0 {
1068 return int(last), last != 0
1069 }
1070 }
1071}

Callers

nothing calls this directly

Calls 2

makeScannerFunction · 0.85
scanMethod · 0.80

Tested by

no test coverage detected