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

Method _getBlockName

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

Source from the content-addressed store, hash-verified

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