MCPcopy Index your code
hub / github.com/jquery/esprima / parseDoWhileStatement

Method parseDoWhileStatement

src/parser.ts:2147–2170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2145 // https://tc39.github.io/ecma262/#sec-do-while-statement
2146
2147 parseDoWhileStatement(): Node.DoWhileStatement {
2148 const node = this.createNode();
2149 this.expectKeyword('do');
2150
2151 const previousInIteration = this.context.inIteration;
2152 this.context.inIteration = true;
2153 const body = this.parseStatement();
2154 this.context.inIteration = previousInIteration;
2155
2156 this.expectKeyword('while');
2157 this.expect('(');
2158 const test = this.parseExpression();
2159
2160 if (!this.match(')') && this.config.tolerant) {
2161 this.tolerateUnexpectedToken(this.nextToken());
2162 } else {
2163 this.expect(')');
2164 if (this.match(';')) {
2165 this.nextToken();
2166 }
2167 }
2168
2169 return this.finalize(node, new Node.DoWhileStatement(body, test));
2170 }
2171
2172 // https://tc39.github.io/ecma262/#sec-while-statement
2173

Callers 1

parseStatementMethod · 0.95

Calls 9

createNodeMethod · 0.95
expectKeywordMethod · 0.95
parseStatementMethod · 0.95
expectMethod · 0.95
parseExpressionMethod · 0.95
matchMethod · 0.95
nextTokenMethod · 0.95
finalizeMethod · 0.95

Tested by

no test coverage detected