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

Method #consumeClassReference

www/js/_hyperscript-max.js:333–356  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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