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

Method consumeASimpleBlock

packages/core/css/CSS3Parser.ts:628–658  ·  view source on GitHub ↗

* 5.4.7. Consume a simple block * https://www.w3.org/TR/css-syntax-3/#consume-a-simple-block

(associatedToken: InputToken)

Source from the content-addressed store, hash-verified

626 * https://www.w3.org/TR/css-syntax-3/#consume-a-simple-block
627 */
628 private consumeASimpleBlock(associatedToken: InputToken): SimpleBlock {
629 const endianToken: ']' | '}' | ')' = {
630 '[': ']',
631 '{': '}',
632 '(': ')',
633 }[<any>associatedToken];
634 const start = this.nextInputCodePointIndex - 1;
635 const block: SimpleBlock = {
636 type: TokenObjectType.simpleBlock,
637 text: undefined,
638 associatedToken,
639 values: [],
640 };
641 let nextInputToken;
642 while ((nextInputToken = this.text[this.nextInputCodePointIndex])) {
643 if (nextInputToken === endianToken) {
644 this.nextInputCodePointIndex++;
645 const end = this.nextInputCodePointIndex;
646 block.text = this.text.substring(start, end);
647
648 return block;
649 }
650 const value = this.consumeAComponentValue();
651 if (value) {
652 block.values.push(value);
653 }
654 }
655 block.text = this.text.substring(start);
656
657 return block;
658 }
659
660 /**
661 * 5.4.8. Consume a function

Callers 3

consumeAnAtRuleMethod · 0.95
consumeAQualifiedRuleMethod · 0.95

Calls 2

pushMethod · 0.45

Tested by

no test coverage detected