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

Method _attemptStr

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

Source from the content-addressed store, hash-verified

571 }
572
573 private _attemptStr(chars: string): boolean {
574 const len = chars.length;
575 if (this._cursor.charsLeft() < len) {
576 return false;
577 }
578 const initialPosition = this._cursor.clone();
579 for (let i = 0; i < len; i++) {
580 if (!this._attemptCharCode(chars.charCodeAt(i))) {
581 // If attempting to parse the string fails, we want to reset the parser
582 // to where it was before the attempt
583 this._cursor = initialPosition;
584 return false;
585 }
586 }
587 return true;
588 }
589
590 private _attemptStrCaseInsensitive(chars: string): boolean {
591 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