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

Function sqlv_scan_file

internal/cbm/sql_values.c:397–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395}
396
397static void sqlv_scan_file(sqlv_scan_t *sc, sqlv_ranges_t *ex) {
398 sqlv_stmt_t st = {false, false, 0};
399 while (sc->i < sc->len && !ex->failed) {
400 if (sqlv_skip_comment(sc)) {
401 continue;
402 }
403 char c = sc->s[sc->i];
404 if (sqlv_skip_any_quoted(sc)) {
405 st.started = true;
406 continue;
407 }
408 if (sqlv_word_char(c)) {
409 sqlv_on_word(sc, &st, ex);
410 continue;
411 }
412 if (c == ';') {
413 st = (sqlv_stmt_t){false, false, 0};
414 } else if (c == '(') {
415 st.depth++;
416 } else if (c == ')' && st.depth > 0) {
417 st.depth--;
418 }
419 if (!isspace((unsigned char)c) && c != ';') {
420 st.started = true;
421 }
422 sqlv_step(sc);
423 }
424}
425
426bool cbm_sql_values_kept_ranges(const char *src, uint32_t len, CBMSqlKeptRanges *out) {
427 out->items = NULL;

Callers 1

Calls 5

sqlv_skip_commentFunction · 0.85
sqlv_skip_any_quotedFunction · 0.85
sqlv_word_charFunction · 0.85
sqlv_on_wordFunction · 0.85
sqlv_stepFunction · 0.85

Tested by

no test coverage detected