MCPcopy Index your code
hub / github.com/BloombergGraphics/whatiscode / parseIfStatement

Function parseIfStatement

scripts/libs/esprima.js:3369–3390  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

3367 // 12.5 If statement
3368
3369 function parseIfStatement(node) {
3370 var test, consequent, alternate;
3371
3372 expectKeyword('if');
3373
3374 expect('(');
3375
3376 test = parseExpression();
3377
3378 expect(')');
3379
3380 consequent = parseStatement();
3381
3382 if (matchKeyword('else')) {
3383 lex();
3384 alternate = parseStatement();
3385 } else {
3386 alternate = null;
3387 }
3388
3389 return node.finishIfStatement(test, consequent, alternate);
3390 }
3391
3392 // 12.6 Iteration Statements
3393

Callers 1

parseStatementFunction · 0.85

Calls 6

expectKeywordFunction · 0.85
expectFunction · 0.85
parseExpressionFunction · 0.85
parseStatementFunction · 0.85
matchKeywordFunction · 0.85
lexFunction · 0.85

Tested by

no test coverage detected