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

Method _getLetDeclarationName

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 3

cloneMethod · 0.65
getCharsMethod · 0.65

Tested by

no test coverage detected