MCPcopy Index your code
hub / github.com/angular/angular / _attemptStr

Method _attemptStr

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

Source from the content-addressed store, hash-verified

592 }
593
594 private _attemptStr(chars: string): boolean {
595 const len = chars.length;
596 if (this._cursor.charsLeft() < len) {
597 return false;
598 }
599 const initialPosition = this._cursor.clone();
600 for (let i = 0; i < len; i++) {
601 if (!this._attemptCharCode(chars.charCodeAt(i))) {
602 // If attempting to parse the string fails, we want to reset the parser
603 // to where it was before the attempt
604 this._cursor = initialPosition;
605 return false;
606 }
607 }
608 return true;
609 }
610
611 private _attemptStrCaseInsensitive(chars: string): boolean {
612 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