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

Method _consumeBlockOpen

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

Source from the content-addressed store, hash-verified

619 }
620
621 private _consumeBlockOpen(token: BlockOpenStartToken) {
622 const parameters: html.BlockParameter[] = [];
623
624 while (this._peek.type === TokenType.BLOCK_PARAMETER) {
625 const paramToken = this._advance<BlockParameterToken>();
626 parameters.push(new html.BlockParameter(paramToken.parts[0], paramToken.sourceSpan));
627 }
628
629 if (this._peek.type === TokenType.BLOCK_OPEN_END) {
630 this._advance();
631 }
632
633 const end = this._peek.sourceSpan.fullStart;
634 const span = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
635 // Create a separate `startSpan` because `span` will be modified when there is an `end` span.
636 const startSpan = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
637 const block = new html.Block(token.parts[0], parameters, [], span, token.sourceSpan, startSpan);
638 this._pushContainer(block, false);
639 }
640
641 private _consumeBlockClose(token: BlockCloseToken) {
642 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