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

Method _consumePrefixAndName

packages/compiler/src/ml_parser/lexer.ts:808–825  ·  view source on GitHub ↗
(endPredicate: (code: number) => boolean)

Source from the content-addressed store, hash-verified

806 }
807
808 private _consumePrefixAndName(endPredicate: (code: number) => boolean): string[] {
809 const nameOrPrefixStart = this._cursor.clone();
810 let prefix: string = '';
811 while (this._cursor.peek() !== chars.$COLON && !isPrefixEnd(this._cursor.peek())) {
812 this._cursor.advance();
813 }
814 let nameStart: CharacterCursor;
815 if (this._cursor.peek() === chars.$COLON && this._cursor.diff(nameOrPrefixStart) > 0) {
816 prefix = this._cursor.getChars(nameOrPrefixStart);
817 this._cursor.advance();
818 nameStart = this._cursor.clone();
819 } else {
820 nameStart = nameOrPrefixStart;
821 }
822 this._requireCharCodeUntilFn(endPredicate, prefix === '' ? 0 : 1);
823 const name = this._cursor.getChars(nameStart);
824 return [prefix, name];
825 }
826
827 private _consumeSingleLineComment(start: CharacterCursor) {
828 const contentStart = this._cursor.clone();

Callers 3

_consumeTagOpenStartMethod · 0.95
_consumeAttributeNameMethod · 0.95
_consumeTagCloseMethod · 0.95

Calls 7

isPrefixEndFunction · 0.85
cloneMethod · 0.65
peekMethod · 0.65
advanceMethod · 0.65
diffMethod · 0.65
getCharsMethod · 0.65

Tested by

no test coverage detected