()
| 996 | } |
| 997 | |
| 998 | private _consumeAttributeValue() { |
| 999 | if (this._cursor.peek() === chars.$SQ || this._cursor.peek() === chars.$DQ) { |
| 1000 | const quoteChar = this._cursor.peek(); |
| 1001 | this._consumeQuote(quoteChar); |
| 1002 | // In an attribute then end of the attribute value and the premature end to an interpolation |
| 1003 | // are both triggered by the `quoteChar`. |
| 1004 | const endPredicate = () => this._cursor.peek() === quoteChar; |
| 1005 | this._consumeWithInterpolation( |
| 1006 | TokenType.ATTR_VALUE_TEXT, |
| 1007 | TokenType.ATTR_VALUE_INTERPOLATION, |
| 1008 | endPredicate, |
| 1009 | endPredicate, |
| 1010 | ); |
| 1011 | this._consumeQuote(quoteChar); |
| 1012 | } else { |
| 1013 | const endPredicate = () => isNameEnd(this._cursor.peek()); |
| 1014 | this._consumeWithInterpolation( |
| 1015 | TokenType.ATTR_VALUE_TEXT, |
| 1016 | TokenType.ATTR_VALUE_INTERPOLATION, |
| 1017 | endPredicate, |
| 1018 | endPredicate, |
| 1019 | ); |
| 1020 | } |
| 1021 | } |
| 1022 | |
| 1023 | private _consumeQuote(quoteChar: number) { |
| 1024 | this._beginToken(TokenType.ATTR_QUOTE); |
no test coverage detected