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

Method skip

packages/compiler/src/expression_parser/parser.ts:1913–1937  ·  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

1911 * and then decrements it just prior to checking if the token is in the input.
1912 */
1913 private skip() {
1914 let n = this.next;
1915 while (
1916 this.index < this.tokens.length &&
1917 !n.isCharacter(chars.$SEMICOLON) &&
1918 !n.isOperator('|') &&
1919 (this.rparensExpected <= 0 || !n.isCharacter(chars.$RPAREN)) &&
1920 (this.rbracesExpected <= 0 || !n.isCharacter(chars.$RBRACE)) &&
1921 (this.rbracketsExpected <= 0 || !n.isCharacter(chars.$RBRACKET)) &&
1922 (!(this.context & ParseContextFlags.Writable) || !this.isAssignmentOperator(n))
1923 ) {
1924 if (this.next.isError()) {
1925 this.errors.push(
1926 getParseError(
1927 this.next.toString()!,
1928 this.input,
1929 this.getErrorLocationText(this.next.index),
1930 this.parseSourceSpan,
1931 ),
1932 );
1933 }
1934 this.advance();
1935 n = this.next;
1936 }
1937 }
1938}
1939
1940function getParseError(

Callers 4

errorMethod · 0.95
upsert_fileMethod · 0.80

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