MCPcopy Index your code
hub / github.com/cube2222/octosql / scanMySQLSpecificComment

Method scanMySQLSpecificComment

parser/sqlparser/token.go:997–1018  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

995}
996
997func (tkn *Tokenizer) scanMySQLSpecificComment() (int, []byte) {
998 buffer := &bytes2.Buffer{}
999 buffer.WriteString("/*!")
1000 tkn.next()
1001 for {
1002 if tkn.lastChar == '*' {
1003 tkn.consumeNext(buffer)
1004 if tkn.lastChar == '/' {
1005 tkn.consumeNext(buffer)
1006 break
1007 }
1008 continue
1009 }
1010 if tkn.lastChar == eofChar {
1011 return LEX_ERROR, buffer.Bytes()
1012 }
1013 tkn.consumeNext(buffer)
1014 }
1015 _, sql := ExtractMysqlComment(buffer.String())
1016 tkn.specialComment = NewStringTokenizer(sql)
1017 return tkn.Scan()
1018}
1019
1020func (tkn *Tokenizer) consumeNext(buffer *bytes2.Buffer) {
1021 if tkn.lastChar == eofChar {

Callers 1

ScanMethod · 0.95

Calls 8

WriteStringMethod · 0.95
nextMethod · 0.95
consumeNextMethod · 0.95
BytesMethod · 0.95
StringMethod · 0.95
ScanMethod · 0.95
ExtractMysqlCommentFunction · 0.85
NewStringTokenizerFunction · 0.85

Tested by

no test coverage detected