MCPcopy Index your code
hub / github.com/gTile/gTile / #parseColRowSpec

Method #parseColRowSpec

src/util/parser.ts:382–405  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

380 }
381
382 #parseColRowSpec(): GridSpec {
383 switch (this.token.kind) {
384 case Literal.Keyword:
385 const mode = this.token.raw;
386 if (mode !== "cols" && mode !== "rows") {
387 break;
388 }
389
390 this.accept();
391 this.accept({ kind: Literal.LParen });
392
393 const cells: GridCellSpec[] = [];
394 do {
395 cells.push(this.#parseCellSpec());
396 } while (this.acceptIf(Literal.Separator));
397
398 this.accept({ kind: Literal.RParen });
399
400 return { mode, cells };
401 }
402
403 throw new ParseError(`Unexpected token "${this.token.raw}" ` +
404 `(type: ${this.token.kind}) at pos ${this.token.position}.`);
405 }
406
407 #parseCellSpec(): GridCellSpec {
408 const weight = this.#parseNumber();

Callers 2

#parseGridSpecMethod · 0.95
#parseCellSpecMethod · 0.95

Calls 1

#parseCellSpecMethod · 0.95

Tested by

no test coverage detected