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

Method #consumeIdReference

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

Source from the content-addressed store, hash-verified

437 }
438
439 #consumeIdReference() {
440 var token = this.#makeToken("ID_REF");
441 var value = this.#consumeChar();
442 if (this.#currentChar() === "{") {
443 token.template = true;
444 value += this.#consumeChar();
445 while (this.#currentChar() && this.#currentChar() !== "}") {
446 value += this.#consumeChar();
447 }
448 if (this.#currentChar() !== "}") {
449 throw new Error("Unterminated id reference");
450 } else {
451 this.#consumeChar();
452 }
453 } else {
454 while (this.#isValidCSSChar(this.#currentChar())) {
455 value += this.#consumeChar();
456 }
457 }
458 token.value = value;
459 token.end = this.#position;
460 return token;
461 }
462
463 #consumeAttributeReference() {
464 var token = this.#makeToken("ATTRIBUTE_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