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

Method #consumeClassReference

www/js/_hyperscript.esm.js:332–355  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

330 return ws;
331 }
332 #consumeClassReference() {
333 var token = this.#makeToken("CLASS_REF");
334 var value = this.#consumeChar();
335 if (this.#currentChar() === "{") {
336 token.template = true;
337 value += this.#consumeChar();
338 while (this.#currentChar() && this.#currentChar() !== "}") {
339 value += this.#consumeChar();
340 }
341 if (this.#currentChar() !== "}") {
342 throw new Error("Unterminated class reference");
343 } else {
344 value += this.#consumeChar();
345 }
346 } else {
347 while (this.#isValidCSSChar(this.#currentChar()) || this.#currentChar() === "\\") {
348 if (this.#currentChar() === "\\") this.#consumeChar();
349 value += this.#consumeChar();
350 }
351 }
352 token.value = value;
353 token.end = this.#position;
354 return token;
355 }
356 #consumeIdReference() {
357 var token = this.#makeToken("ID_REF");
358 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