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

Method #consumeIdentifier

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

Source from the content-addressed store, hash-verified

566 }
567
568 #consumeIdentifier() {
569 var token = this.#makeToken("IDENTIFIER");
570 var value = this.#consumeChar();
571 while (this.#isAlpha(this.#currentChar()) || this.#isNumeric(this.#currentChar()) || this.#isIdentifierChar(this.#currentChar())) {
572 value += this.#consumeChar();
573 }
574 if (this.#currentChar() === "!" && value === "beep") {
575 value += this.#consumeChar();
576 }
577 token.value = value;
578 token.end = this.#position;
579 return token;
580 }
581
582 #consumeNumber() {
583 var token = this.#makeToken("NUMBER");

Callers 2

#tokenizeMethod · 0.95

Calls 6

#makeTokenMethod · 0.95
#consumeCharMethod · 0.95
#isAlphaMethod · 0.95
#currentCharMethod · 0.95
#isNumericMethod · 0.95
#isIdentifierCharMethod · 0.95

Tested by

no test coverage detected