MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / parseWidgetRef

Method parseWidgetRef

packages/core/src/constraints/parser.ts:291–308  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

289 }
290
291 private parseWidgetRef(): ExprNode {
292 this.expect("#");
293 const start = this.pos;
294 while (true) {
295 const ch = this.peek();
296 if (ch === null || ch === "." || isWhitespace(ch)) break;
297 this.pos++;
298 }
299 const id = this.source.slice(start, this.pos);
300 if (id.length === 0) this.fail('Expected widget ID after "#"');
301 if (!this.consumeIf(".")) this.fail('Expected "." after widget ID');
302 const prop = this.readProp();
303 return {
304 kind: "ref",
305 scope: { kind: "widget", id },
306 prop,
307 };
308 }
309
310 private parseNumberNode(): Readonly<{ kind: "number"; value: number }> {
311 const start = this.pos;

Callers 1

parseAtomMethod · 0.95

Calls 6

expectMethod · 0.95
peekMethod · 0.95
failMethod · 0.95
consumeIfMethod · 0.95
readPropMethod · 0.95
isWhitespaceFunction · 0.70

Tested by

no test coverage detected