MCPcopy Create free account
hub / github.com/dchester/jsonpath / parseConditionalExpression

Function parseConditionalExpression

jsonpath.js:2547–2568  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2545 // 11.12 Conditional Operator
2546
2547 function parseConditionalExpression() {
2548 var expr, previousAllowIn, consequent, alternate, startToken;
2549
2550 startToken = lookahead;
2551
2552 expr = parseBinaryExpression();
2553
2554 if (match('?')) {
2555 lex();
2556 previousAllowIn = state.allowIn;
2557 state.allowIn = true;
2558 consequent = parseAssignmentExpression();
2559 state.allowIn = previousAllowIn;
2560 expect(':');
2561 alternate = parseAssignmentExpression();
2562
2563 expr = delegate.createConditionalExpression(expr, consequent, alternate);
2564 delegate.markEnd(expr, startToken);
2565 }
2566
2567 return expr;
2568 }
2569
2570 // 11.13 Assignment Operators
2571

Callers 1

Calls 5

parseBinaryExpressionFunction · 0.85
matchFunction · 0.85
expectFunction · 0.85
lexFunction · 0.70

Tested by

no test coverage detected