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

Method _consumeBlockClose

packages/compiler/src/ml_parser/parser.ts:641–670  ·  view source on GitHub ↗
(token: BlockCloseToken)

Source from the content-addressed store, hash-verified

639 }
640
641 private _consumeBlockClose(token: BlockCloseToken) {
642 const initialStackLength = this._containerStack.length;
643 const topNode = this._containerStack[initialStackLength - 1];
644 if (!this._popContainer(null, html.Block, token.sourceSpan)) {
645 if (this._containerStack.length < initialStackLength) {
646 const nodeName = topNode.name;
647 this.errors.push(
648 TreeError.create(
649 null,
650 token.sourceSpan,
651 `Unexpected closing block. The block may have been closed earlier. ` +
652 `Did you forget to close the <${nodeName}> element? ` +
653 `If you meant to write the \`}\` character, you should use the "&#125;" ` +
654 `HTML entity instead.`,
655 ),
656 );
657 return;
658 }
659
660 this.errors.push(
661 TreeError.create(
662 null,
663 token.sourceSpan,
664 `Unexpected closing block. The block may have been closed earlier. ` +
665 `If you meant to write the \`}\` character, you should use the "&#125;" ` +
666 `HTML entity instead.`,
667 ),
668 );
669 }
670 }
671
672 private _consumeIncompleteBlock(token: IncompleteBlockOpenToken) {
673 const parameters: html.BlockParameter[] = [];

Callers 1

buildMethod · 0.95

Calls 3

_popContainerMethod · 0.95
createMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected