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

Method _attemptStr

packages/compiler/src/ml_parser/lexer.ts:588–603  ·  view source on GitHub ↗
(chars: string)

Source from the content-addressed store, hash-verified

586 }
587
588 private _attemptStr(chars: string): boolean {
589 const len = chars.length;
590 if (this._cursor.charsLeft() < len) {
591 return false;
592 }
593 const initialPosition = this._cursor.clone();
594 for (let i = 0; i < len; i++) {
595 if (!this._attemptCharCode(chars.charCodeAt(i))) {
596 // If attempting to parse the string fails, we want to reset the parser
597 // to where it was before the attempt
598 this._cursor = initialPosition;
599 return false;
600 }
601 }
602 return true;
603 }
604
605 private _attemptStrCaseInsensitive(chars: string): boolean {
606 for (let i = 0; i < chars.length; i++) {

Callers 8

_requireStrMethod · 0.95
_consumeCommentMethod · 0.95
_consumeCdataMethod · 0.95
_consumeTagOpenMethod · 0.95
_consumeInterpolationMethod · 0.95
isExpansionFormStartMethod · 0.95

Calls 3

_attemptCharCodeMethod · 0.95
charsLeftMethod · 0.65
cloneMethod · 0.65

Tested by

no test coverage detected