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

Method #consumeClassReference

src/core/tokenizer.js:414–437  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

412 }
413
414 #consumeClassReference() {
415 var token = this.#makeToken("CLASS_REF");
416 var value = this.#consumeChar();
417 if (this.#currentChar() === "{") {
418 token.template = true;
419 value += this.#consumeChar();
420 while (this.#currentChar() && this.#currentChar() !== "}") {
421 value += this.#consumeChar();
422 }
423 if (this.#currentChar() !== "}") {
424 throw new Error("Unterminated class reference");
425 } else {
426 value += this.#consumeChar();
427 }
428 } else {
429 while (this.#isValidCSSChar(this.#currentChar()) || this.#currentChar() === "\\") {
430 if (this.#currentChar() === "\\") this.#consumeChar();
431 value += this.#consumeChar();
432 }
433 }
434 token.value = value;
435 token.end = this.#position;
436 return token;
437 }
438
439 #consumeIdReference() {
440 var token = this.#makeToken("ID_REF");

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