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

Function RuleParser

src/tailwindcss.test.ts:63–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61}
62
63function* RuleParser(): ParseGenerator<CSSRule> {
64 const declarations: Array<CSSDeclaration> = [];
65
66 // const [selector] = yield /(:root|[*]|[a-z][\w]*)/;
67
68 const selectors: Array<string> = [];
69 yield whitespaceMay;
70 while (true) {
71 selectors.push(yield SelectorComponentParser);
72 yield whitespaceMay;
73 if (yield has(',')) {
74 yield whitespaceMay;
75 continue;
76 }
77
78 if (yield has('{')) break;
79 }
80
81 // yield whitespaceMay;
82 // yield "{";
83 yield whitespaceMay;
84 while ((yield has('}')) === false) {
85 declarations.push(yield DeclarationParser);
86 yield whitespaceMay;
87 }
88
89 return { type: 'rule', selectors: selectors, declarations };
90}
91
92function* MediaQueryParser() {
93 yield '@media';

Callers

nothing calls this directly

Calls 1

hasFunction · 0.90

Tested by

no test coverage detected