MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / sqlv_skip_comment

Function sqlv_skip_comment

internal/cbm/sql_values.c:124–146  ·  view source on GitHub ↗

Consume one comment starting at the cursor; false if there is none. */

Source from the content-addressed store, hash-verified

122
123/* Consume one comment starting at the cursor; false if there is none. */
124static bool sqlv_skip_comment(sqlv_scan_t *sc) {
125 char c = sqlv_at(sc, 0);
126 char n = sqlv_at(sc, 1);
127 if ((c == '-' && n == '-') || c == '#') {
128 while (sc->i < sc->len && sc->s[sc->i] != '\n') {
129 sqlv_step(sc);
130 }
131 return true;
132 }
133 if (c == '/' && n == '*') {
134 sqlv_step(sc);
135 sqlv_step(sc);
136 while (sc->i < sc->len && !(sc->s[sc->i] == '*' && sqlv_at(sc, 1) == '/')) {
137 sqlv_step(sc);
138 }
139 if (sc->i < sc->len) {
140 sqlv_step(sc);
141 sqlv_step(sc);
142 }
143 return true;
144 }
145 return false;
146}
147
148/* Skip whitespace and comments. *ws_only (optional) is cleared if a comment was
149 * among them. */

Callers 3

sqlv_skip_triviaFunction · 0.85
sqlv_skip_balancedFunction · 0.85
sqlv_scan_fileFunction · 0.85

Calls 2

sqlv_atFunction · 0.85
sqlv_stepFunction · 0.85

Tested by

no test coverage detected