MCPcopy Index your code
hub / github.com/JavaScriptRegenerated/yieldparser / RuleParser

Function RuleParser

src/index.test.ts:409–424  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

407 }
408
409 function* RuleParser() {
410 const declarations: Array<Declaraction> = [];
411
412 const [selector]: [string] = yield /^(:root|[*]|[a-z][\w]*)/;
413
414 yield whitespaceMay;
415 yield '{';
416 yield whitespaceMay;
417 while ((yield has('}')) === false) {
418 yield whitespaceMay;
419 declarations.push(yield DeclarationParser);
420 yield whitespaceMay;
421 }
422
423 return { selectors: [selector], declarations } as Rule;
424 }
425
426 function* RulesParser(): ParseGenerator<Array<Rule>> {
427 const rules: Array<Rule> = [];

Callers

nothing calls this directly

Calls 1

hasFunction · 0.90

Tested by

no test coverage detected