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

Method _consumeAttributeValue

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

Source from the content-addressed store, hash-verified

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

Callers 1

_consumeAttributeMethod · 0.95

Calls 3

_consumeQuoteMethod · 0.95
peekMethod · 0.65

Tested by

no test coverage detected