()
| 1056 | } |
| 1057 | |
| 1058 | private _consumeAttributeValue() { |
| 1059 | if (this._cursor.peek() === chars.$SQ || this._cursor.peek() === chars.$DQ) { |
| 1060 | const quoteChar = this._cursor.peek(); |
| 1061 | this._consumeQuote(quoteChar); |
| 1062 | // In an attribute then end of the attribute value and the premature end to an interpolation |
| 1063 | // are both triggered by the `quoteChar`. |
| 1064 | const endPredicate = () => this._cursor.peek() === quoteChar; |
| 1065 | this._consumeWithInterpolation( |
| 1066 | TokenType.ATTR_VALUE_TEXT, |
| 1067 | TokenType.ATTR_VALUE_INTERPOLATION, |
| 1068 | endPredicate, |
| 1069 | endPredicate, |
| 1070 | ); |
| 1071 | this._consumeQuote(quoteChar); |
| 1072 | } else { |
| 1073 | const endPredicate = () => isNameEnd(this._cursor.peek()); |
| 1074 | this._consumeWithInterpolation( |
| 1075 | TokenType.ATTR_VALUE_TEXT, |
| 1076 | TokenType.ATTR_VALUE_INTERPOLATION, |
| 1077 | endPredicate, |
| 1078 | endPredicate, |
| 1079 | ); |
| 1080 | } |
| 1081 | } |
| 1082 | |
| 1083 | private _consumeQuote(quoteChar: number) { |
| 1084 | this._beginToken(TokenType.ATTR_QUOTE); |
no test coverage detected