MCPcopy
hub / github.com/niklasvh/html2canvas / parseComponentValue

Method parseComponentValue

src/css/syntax/parser.ts:50–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48 }
49
50 parseComponentValue(): CSSValue {
51 let token = this.consumeToken();
52 while (token.type === TokenType.WHITESPACE_TOKEN) {
53 token = this.consumeToken();
54 }
55
56 if (token.type === TokenType.EOF_TOKEN) {
57 throw new SyntaxError(`Error parsing CSS component value, unexpected EOF`);
58 }
59
60 this.reconsumeToken(token);
61 const value = this.consumeComponentValue();
62
63 do {
64 token = this.consumeToken();
65 } while (token.type === TokenType.WHITESPACE_TOKEN);
66
67 if (token.type === TokenType.EOF_TOKEN) {
68 return value;
69 }
70
71 throw new SyntaxError(`Error parsing CSS component value, multiple values found when expecting only one`);
72 }
73
74 parseComponentValues(): CSSValue[] {
75 const values = [];

Callers 3

parseFunction · 0.95
parseValueMethod · 0.80
parseColorFunction · 0.80

Calls 3

consumeTokenMethod · 0.95
reconsumeTokenMethod · 0.95
consumeComponentValueMethod · 0.95

Tested by

no test coverage detected