()
| 1073 | } |
| 1074 | |
| 1075 | private _consumeAttributeValue() { |
| 1076 | if (this._cursor.peek() === chars.$SQ || this._cursor.peek() === chars.$DQ) { |
| 1077 | const quoteChar = this._cursor.peek(); |
| 1078 | this._consumeQuote(quoteChar); |
| 1079 | // In an attribute then end of the attribute value and the premature end to an interpolation |
| 1080 | // are both triggered by the `quoteChar`. |
| 1081 | const endPredicate = () => this._cursor.peek() === quoteChar; |
| 1082 | this._consumeWithInterpolation( |
| 1083 | TokenType.ATTR_VALUE_TEXT, |
| 1084 | TokenType.ATTR_VALUE_INTERPOLATION, |
| 1085 | endPredicate, |
| 1086 | endPredicate, |
| 1087 | ); |
| 1088 | this._consumeQuote(quoteChar); |
| 1089 | } else { |
| 1090 | const endPredicate = () => isNameEnd(this._cursor.peek()); |
| 1091 | this._consumeWithInterpolation( |
| 1092 | TokenType.ATTR_VALUE_TEXT, |
| 1093 | TokenType.ATTR_VALUE_INTERPOLATION, |
| 1094 | endPredicate, |
| 1095 | endPredicate, |
| 1096 | ); |
| 1097 | } |
| 1098 | } |
| 1099 | |
| 1100 | private _consumeQuote(quoteChar: number) { |
| 1101 | this._beginToken(TokenType.ATTR_QUOTE); |
no test coverage detected