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

Method consumeAnAtRule

packages/core/css/CSS3Parser.ts:537–565  ·  view source on GitHub ↗

* 5.4.2. Consume an at-rule * https://www.w3.org/TR/css-syntax-3/#consume-an-at-rule

()

Source from the content-addressed store, hash-verified

535 * https://www.w3.org/TR/css-syntax-3/#consume-an-at-rule
536 */
537 public consumeAnAtRule(): AtRule {
538 let inputToken = this.consumeAToken();
539 const atRule: AtRule = {
540 type: 'at-rule',
541 name: (<AtKeywordToken>inputToken).text,
542 prelude: [],
543 block: undefined,
544 };
545 while ((inputToken = this.consumeAToken())) {
546 if (inputToken === ';') {
547 return atRule;
548 } else if (inputToken === '{') {
549 atRule.block = this.consumeASimpleBlock(inputToken);
550
551 return atRule;
552 } else if ((<InputTokenObject>inputToken).type === TokenObjectType.simpleBlock && (<SimpleBlock>inputToken).associatedToken === '{') {
553 atRule.block = <SimpleBlock>inputToken;
554
555 return atRule;
556 }
557 this.reconsumeTheCurrentInputToken(inputToken);
558 const component = this.consumeAComponentValue();
559 if (component) {
560 atRule.prelude.push(component);
561 }
562 }
563
564 return atRule;
565 }
566
567 /**
568 * 5.4.3. Consume a qualified rule

Callers 1

consumeAListOfRulesMethod · 0.95

Calls 5

consumeATokenMethod · 0.95
consumeASimpleBlockMethod · 0.95
pushMethod · 0.45

Tested by

no test coverage detected