MCPcopy Create free account
hub / github.com/bytebase/dbhub / scanMultiLineComment

Function scanMultiLineComment

src/utils/sql-parser.ts:45–51  ·  view source on GitHub ↗
(sql: string, i: number)

Source from the content-addressed store, hash-verified

43}
44
45function scanMultiLineComment(sql: string, i: number): SQLToken | null {
46 if (sql[i] !== "/" || sql[i + 1] !== "*") { return null; }
47 let j = i + 2;
48 while (j < sql.length && !(sql[j] === "*" && sql[j + 1] === "/")) { j++; }
49 if (j < sql.length) { j += 2; }
50 return { type: TokenType.Comment, end: j };
51}
52
53/**
54 * MySQL/MariaDB-specific multi-line comment scanner that preserves conditional comments.

Callers 4

scanTokenAnsiFunction · 0.85
scanTokenSQLiteFunction · 0.85
scanTokenSQLServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected