MCPcopy Index your code
hub / github.com/angular/angular / _consumeBlockOpen

Method _consumeBlockOpen

packages/compiler/src/ml_parser/parser.ts:753–771  ·  view source on GitHub ↗
(token: BlockOpenStartToken)

Source from the content-addressed store, hash-verified

751 }
752
753 private _consumeBlockOpen(token: BlockOpenStartToken) {
754 const parameters: html.BlockParameter[] = [];
755
756 while (this._peek.type === TokenType.BLOCK_PARAMETER) {
757 const paramToken = this._advance<BlockParameterToken>();
758 parameters.push(new html.BlockParameter(paramToken.parts[0], paramToken.sourceSpan));
759 }
760
761 if (this._peek.type === TokenType.BLOCK_OPEN_END) {
762 this._advance();
763 }
764
765 const end = this._peek.sourceSpan.fullStart;
766 const span = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
767 // Create a separate `startSpan` because `span` will be modified when there is an `end` span.
768 const startSpan = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
769 const block = new html.Block(token.parts[0], parameters, [], span, token.sourceSpan, startSpan);
770 this._pushContainer(block, false);
771 }
772
773 private _consumeBlockClose(token: BlockCloseToken) {
774 const initialStackLength = this._containerStack.length;

Callers 1

buildMethod · 0.95

Calls 3

_advanceMethod · 0.95
_pushContainerMethod · 0.95
pushMethod · 0.45

Tested by

no test coverage detected