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

Method _getLetDeclarationName

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

Source from the content-addressed store, hash-verified

434 }
435
436 private _getLetDeclarationName(): string {
437 const nameCursor = this._cursor.clone();
438 let allowDigit = false;
439
440 this._attemptCharCodeUntilFn((code) => {
441 if (
442 chars.isAsciiLetter(code) ||
443 code === chars.$$ ||
444 code === chars.$_ ||
445 // `@let` names can't start with a digit, but digits are valid anywhere else in the name.
446 (allowDigit && chars.isDigit(code))
447 ) {
448 allowDigit = true;
449 return false;
450 }
451 return true;
452 });
453
454 return this._cursor.getChars(nameCursor).trim();
455 }
456
457 private _consumeLetDeclarationValue(): void {
458 const start = this._cursor.clone();

Callers 1

Calls 3

cloneMethod · 0.65
getCharsMethod · 0.65

Tested by

no test coverage detected