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

Method _getBlockName

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

Source from the content-addressed store, hash-verified

277 }
278
279 private _getBlockName(): string {
280 // This allows us to capture up something like `@else if`, but not `@ if`.
281 let spacesInNameAllowed = false;
282 const nameCursor = this._cursor.clone();
283
284 this._attemptCharCodeUntilFn((code) => {
285 if (chars.isWhitespace(code)) {
286 return !spacesInNameAllowed;
287 }
288 if (isBlockNameChar(code)) {
289 spacesInNameAllowed = true;
290 return false;
291 }
292 return true;
293 });
294 return this._cursor.getChars(nameCursor).trim();
295 }
296
297 private _consumeBlockStart(start: CharacterCursor) {
298 this._requireCharCode(chars.$AT);

Callers 1

_consumeBlockStartMethod · 0.95

Calls 4

isBlockNameCharFunction · 0.85
cloneMethod · 0.65
getCharsMethod · 0.65

Tested by

no test coverage detected