()
| 537 | } |
| 538 | |
| 539 | #consumeTemplateIdentifier() { |
| 540 | var token = this.#makeToken("IDENTIFIER"); |
| 541 | var value = this.#consumeChar(); |
| 542 | var escaped = value === "\\"; |
| 543 | if (escaped) value = ""; |
| 544 | while (this.#isAlpha(this.#currentChar()) || |
| 545 | this.#isNumeric(this.#currentChar()) || |
| 546 | this.#isIdentifierChar(this.#currentChar()) || |
| 547 | this.#currentChar() === "\\" || |
| 548 | this.#currentChar() === "{" || |
| 549 | this.#currentChar() === "}") { |
| 550 | if (this.#currentChar() === "$" && !escaped) { |
| 551 | break; |
| 552 | } else if (this.#currentChar() === "\\") { |
| 553 | escaped = true; |
| 554 | this.#consumeChar(); |
| 555 | } else { |
| 556 | escaped = false; |
| 557 | value += this.#consumeChar(); |
| 558 | } |
| 559 | } |
| 560 | if (this.#currentChar() === "!" && value === "beep") { |
| 561 | value += this.#consumeChar(); |
| 562 | } |
| 563 | token.value = value; |
| 564 | token.end = this.#position; |
| 565 | return token; |
| 566 | } |
| 567 | |
| 568 | #consumeIdentifier() { |
| 569 | var token = this.#makeToken("IDENTIFIER"); |
no test coverage detected