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

Method _getLetDeclarationName

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

Source from the content-addressed store, hash-verified

449 }
450
451 private _getLetDeclarationName(): string {
452 const nameCursor = this._cursor.clone();
453 let allowDigit = false;
454
455 this._attemptCharCodeUntilFn((code) => {
456 if (
457 chars.isAsciiLetter(code) ||
458 code === chars.$$ ||
459 code === chars.$_ ||
460 // `@let` names can't start with a digit, but digits are valid anywhere else in the name.
461 (allowDigit && chars.isDigit(code))
462 ) {
463 allowDigit = true;
464 return false;
465 }
466 return true;
467 });
468
469 return this._cursor.getChars(nameCursor).trim();
470 }
471
472 private _consumeLetDeclarationValue(): void {
473 const start = this._cursor.clone();

Callers 1

Calls 3

cloneMethod · 0.65
getCharsMethod · 0.65

Tested by

no test coverage detected