MCPcopy Create free account
hub / github.com/bytebase/bytebase / skipBlockComment

Function skipBlockComment

backend/plugin/parser/tsql/backup.go:498–516  ·  view source on GitHub ↗
(source string, start, end int)

Source from the content-addressed store, hash-verified

496}
497
498func skipBlockComment(source string, start, end int) int {
499 depth := 1
500 for start+1 < end {
501 switch {
502 case source[start] == '/' && source[start+1] == '*':
503 depth++
504 start += 2
505 case source[start] == '*' && source[start+1] == '/':
506 depth--
507 start += 2
508 if depth == 0 {
509 return start
510 }
511 default:
512 start++
513 }
514 }
515 return end
516}
517
518func sourceFromLoc(source string, loc ast.Loc) string {
519 if loc.Start < 0 || loc.End < 0 || loc.Start >= len(source) {

Callers 1

findKeywordOutsideSQLFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected