2024-04-27 12:05:21 -07:00
|
|
|
const src = Deno.readTextFileSync("sqlite-vec.c");
|
|
|
|
|
|
|
|
|
|
function numOccuranges(rg) {
|
|
|
|
|
return [...src.matchAll(rg)].length;
|
|
|
|
|
}
|
|
|
|
|
const numAsserts = numOccuranges(/todo_assert/g);
|
|
|
|
|
const numComments = numOccuranges(/TODO/g);
|
|
|
|
|
const numHandles = numOccuranges(/todo\(/g);
|
|
|
|
|
|
|
|
|
|
const realTodos = numOccuranges(/TODO\(/g);
|
|
|
|
|
|
|
|
|
|
const numTotal = numAsserts + numComments + numHandles - realTodos;
|
|
|
|
|
|
|
|
|
|
console.log("Number of todo_assert()'s: ", numAsserts);
|
|
|
|
|
console.log('Number of "// TODO" comments: ', numComments);
|
|
|
|
|
console.log("Number of todo panics: ", numHandles);
|
|
|
|
|
console.log("Total TODOs: ", numTotal);
|
|
|
|
|
|
|
|
|
|
console.log();
|
|
|
|
|
|
|
|
|
|
const TOTAL = 246; // as of e5b0f4c0c5 (2024-04-20)
|
|
|
|
|
const progress = (TOTAL - numTotal) / TOTAL;
|
|
|
|
|
const width = 60;
|
|
|
|
|
|
|
|
|
|
console.log(
|
2024-05-17 12:03:45 -07:00
|
|
|
"▓".repeat((progress < 0 ? 0 : progress) * width) +
|
2024-04-27 12:05:21 -07:00
|
|
|
"░".repeat((1 - progress) * width) +
|
2024-07-31 12:56:02 -07:00
|
|
|
` (${TOTAL - numTotal}/${TOTAL})`,
|
2024-04-27 12:05:21 -07:00
|
|
|
);
|
|
|
|
|
console.log();
|
2024-05-12 00:39:04 -07:00
|
|
|
console.log(
|
2024-07-31 12:56:02 -07:00
|
|
|
`${(progress * 100.0).toPrecision(2)}% complete to sqlite-vec v0.1.0`,
|
2024-05-12 00:39:04 -07:00
|
|
|
);
|