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

Method skip

packages/compiler/src/expression_parser/parser.ts:1867–1891  ·  view source on GitHub ↗

* Error recovery should skip tokens until it encounters a recovery point. * * The following are treated as unconditional recovery points: * - end of input * - ';' (parseChain() is always the root production, and it expects a ';') * - '|' (since pipes may be chained and each pipe

()

Source from the content-addressed store, hash-verified

1865 * and then decrements it just prior to checking if the token is in the input.
1866 */
1867 private skip() {
1868 let n = this.next;
1869 while (
1870 this.index < this.tokens.length &&
1871 !n.isCharacter(chars.$SEMICOLON) &&
1872 !n.isOperator('|') &&
1873 (this.rparensExpected <= 0 || !n.isCharacter(chars.$RPAREN)) &&
1874 (this.rbracesExpected <= 0 || !n.isCharacter(chars.$RBRACE)) &&
1875 (this.rbracketsExpected <= 0 || !n.isCharacter(chars.$RBRACKET)) &&
1876 (!(this.context & ParseContextFlags.Writable) || !this.isAssignmentOperator(n))
1877 ) {
1878 if (this.next.isError()) {
1879 this.errors.push(
1880 getParseError(
1881 this.next.toString()!,
1882 this.input,
1883 this.getErrorLocationText(this.next.index),
1884 this.parseSourceSpan,
1885 ),
1886 );
1887 }
1888 this.advance();
1889 n = this.next;
1890 }
1891 }
1892}
1893
1894function getParseError(

Callers 2

errorMethod · 0.95

Calls 9

isAssignmentOperatorMethod · 0.95
getErrorLocationTextMethod · 0.95
advanceMethod · 0.95
getParseErrorFunction · 0.85
isCharacterMethod · 0.80
isOperatorMethod · 0.80
isErrorMethod · 0.80
toStringMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected