LastLexicalToken returns the last lexical token. If the string has no lexical tokens, returns 0 and ok=false.
(sql string)
| 1003 | // LastLexicalToken returns the last lexical token. If the string has no lexical |
| 1004 | // tokens, returns 0 and ok=false. |
| 1005 | func LastLexicalToken(sql string) (lastTok int, ok bool) { |
| 1006 | s := makeScanner(sql) |
| 1007 | var lval sqlSymType |
| 1008 | for { |
| 1009 | last := lval.id |
| 1010 | s.scan(&lval) |
| 1011 | if lval.id == 0 { |
| 1012 | return int(last), last != 0 |
| 1013 | } |
| 1014 | } |
| 1015 | } |
| 1016 | |
| 1017 | // EndsInSemicolon returns true if the last lexical token is a semicolon. |
| 1018 | func EndsInSemicolon(sql string) bool { |
no test coverage detected
searching dependent graphs…