MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / consumeAListOfRules

Method consumeAListOfRules

packages/core/css/CSS3Parser.ts:495–531  ·  view source on GitHub ↗

* 5.4.1. Consume a list of rules * https://www.w3.org/TR/css-syntax-3/#consume-a-list-of-rules

()

Source from the content-addressed store, hash-verified

493 * https://www.w3.org/TR/css-syntax-3/#consume-a-list-of-rules
494 */
495 public consumeAListOfRules(): Rule[] {
496 const rules: Rule[] = [];
497 let inputToken: InputToken;
498 while ((inputToken = this.consumeAToken())) {
499 switch (inputToken) {
500 case ' ':
501 continue;
502 case '<!--':
503 case '-->': {
504 if (this.topLevelFlag) {
505 continue;
506 }
507 this.reconsumeTheCurrentInputToken(inputToken);
508 const atRule = this.consumeAnAtRule();
509 if (atRule) {
510 rules.push(atRule);
511 }
512 continue;
513 }
514 }
515 if ((<InputTokenObject>inputToken).type === TokenObjectType.atKeyword) {
516 this.reconsumeTheCurrentInputToken(inputToken);
517 const atRule = this.consumeAnAtRule();
518 if (atRule) {
519 rules.push(atRule);
520 }
521 continue;
522 }
523 this.reconsumeTheCurrentInputToken(inputToken);
524 const qualifiedRule = this.consumeAQualifiedRule();
525 if (qualifiedRule) {
526 rules.push(qualifiedRule);
527 }
528 }
529
530 return rules;
531 }
532
533 /**
534 * 5.4.2. Consume an at-rule

Callers 1

parseAStylesheetMethod · 0.95

Calls 5

consumeATokenMethod · 0.95
consumeAnAtRuleMethod · 0.95
consumeAQualifiedRuleMethod · 0.95
pushMethod · 0.45

Tested by

no test coverage detected