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

Method parseAtom

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

Source from the content-addressed store, hash-verified

176 }
177
178 private parseAtom(): ExprNode {
179 this.skipWhitespace();
180 const ch = this.peek();
181 if (ch === null) this.fail("Unexpected end of input");
182
183 if (ch === "(") {
184 this.pos++;
185 const inner = this.parseExpr();
186 this.skipWhitespace();
187 if (!this.consumeIf(")")) this.fail('Expected ")"');
188 return inner;
189 }
190
191 if (ch === "#") return this.parseWidgetRef();
192 if (isDigit(ch)) return this.parseNumberNode();
193 if (isIdentifierStart(ch)) return this.parseNamedAtom();
194 this.fail(`Unexpected token "${ch}"`);
195 }
196
197 private parseNamedAtom(): ExprNode {
198 const identStart = this.pos;

Callers 1

parseUnaryMethod · 0.95

Calls 10

skipWhitespaceMethod · 0.95
peekMethod · 0.95
failMethod · 0.95
parseExprMethod · 0.95
consumeIfMethod · 0.95
parseWidgetRefMethod · 0.95
parseNumberNodeMethod · 0.95
parseNamedAtomMethod · 0.95
isIdentifierStartFunction · 0.85
isDigitFunction · 0.70

Tested by

no test coverage detected