MCPcopy Create free account
hub / github.com/angular/angular / _consumeAttributeValue

Method _consumeAttributeValue

packages/compiler/src/ml_parser/lexer.ts:1075–1098  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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);

Callers 1

_consumeAttributeMethod · 0.95

Calls 3

_consumeQuoteMethod · 0.95
peekMethod · 0.65

Tested by

no test coverage detected