MCPcopy Index your code
hub / github.com/outerbase/studio / consumeParen

Method consumeParen

src/drivers/sqlite/sql-parse-table.ts:62–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60 }
61
62 consumeParen(): CursorV2 {
63 if (this.read() !== "(") throw new Error("Expecting (");
64
65 const start = this.ptr + 1;
66 let counter = 1;
67
68 // Find the matching closing paren
69 while (counter > 0) {
70 if (!this.next()) throw new Error("Expecting closing paren");
71 if (this.read() === "(") counter++;
72 if (this.read() === ")") counter--;
73 }
74
75 const newCursor = new CursorV2(this.tokens.slice(start, this.ptr));
76 this.next();
77
78 return newCursor;
79 }
80
81 consume() {
82 const value = this.read();

Callers 4

consumeBlockMethod · 0.95
parseCreateTableScriptFunction · 0.95
parseColumnDefFunction · 0.80
parseColumnConstraintFunction · 0.80

Calls 2

readMethod · 0.95
nextMethod · 0.95

Tested by

no test coverage detected