MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / #consumeClassReference

Method #consumeClassReference

www/js/ext/component.js:327–350  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

325 return ws;
326 }
327 #consumeClassReference() {
328 var token = this.#makeToken("CLASS_REF");
329 var value = this.#consumeChar();
330 if (this.#currentChar() === "{") {
331 token.template = true;
332 value += this.#consumeChar();
333 while (this.#currentChar() && this.#currentChar() !== "}") {
334 value += this.#consumeChar();
335 }
336 if (this.#currentChar() !== "}") {
337 throw new Error("Unterminated class reference");
338 } else {
339 value += this.#consumeChar();
340 }
341 } else {
342 while (this.#isValidCSSChar(this.#currentChar()) || this.#currentChar() === "\\") {
343 if (this.#currentChar() === "\\") this.#consumeChar();
344 value += this.#consumeChar();
345 }
346 }
347 token.value = value;
348 token.end = this.#position;
349 return token;
350 }
351 #consumeIdReference() {
352 var token = this.#makeToken("ID_REF");
353 var value = this.#consumeChar();

Callers 1

#tokenizeMethod · 0.95

Calls 4

#makeTokenMethod · 0.95
#consumeCharMethod · 0.95
#currentCharMethod · 0.95
#isValidCSSCharMethod · 0.95

Tested by

no test coverage detected