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

Method #consumeIdReference

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

Source from the content-addressed store, hash-verified

355 return token;
356 }
357 #consumeIdReference() {
358 var token = this.#makeToken("ID_REF");
359 var value = this.#consumeChar();
360 if (this.#currentChar() === "{") {
361 token.template = true;
362 value += this.#consumeChar();
363 while (this.#currentChar() && this.#currentChar() !== "}") {
364 value += this.#consumeChar();
365 }
366 if (this.#currentChar() !== "}") {
367 throw new Error("Unterminated id reference");
368 } else {
369 this.#consumeChar();
370 }
371 } else {
372 while (this.#isValidCSSChar(this.#currentChar())) {
373 value += this.#consumeChar();
374 }
375 }
376 token.value = value;
377 token.end = this.#position;
378 return token;
379 }
380 #consumeAttributeReference() {
381 var token = this.#makeToken("ATTRIBUTE_REF");
382 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