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

Method scanQuestion

packages/compiler/src/expression_parser/lexer.ts:536–555  ·  view source on GitHub ↗
(start: number)

Source from the content-addressed store, hash-verified

534 }
535
536 private scanQuestion(start: number): Token {
537 this.advance();
538 let operator = '?';
539 // `a ?? b` or `a ??= b`.
540 if (this.peek === chars.$QUESTION) {
541 operator += '?';
542 this.advance();
543
544 // @ts-expect-error
545 if (this.peek === chars.$EQ) {
546 operator += '=';
547 this.advance();
548 }
549 } else if (this.peek === chars.$PERIOD) {
550 // `a?.b`
551 operator += '.';
552 this.advance();
553 }
554 return newOperatorToken(start, this.index, operator);
555 }
556
557 private scanTemplateLiteralPart(start: number): Token {
558 let buffer = '';

Callers 1

scanTokenMethod · 0.95

Calls 2

advanceMethod · 0.95
newOperatorTokenFunction · 0.85

Tested by

no test coverage detected