MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxConditionalExpression

Function fxConditionalExpression

xs/sources/xsSyntaxical.c:1879–1895  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1877}
1878
1879void fxConditionalExpression(txParser* parser)
1880{
1881 fxCoalesceExpression(parser);
1882 if (parser->states[0].token == XS_TOKEN_QUESTION_MARK) {
1883 txInteger aLine = parser->states[0].line;
1884 txUnsigned flags;
1885 fxCheckArrowFunction(parser, 1);
1886 fxGetNextToken(parser);
1887 flags = parser->flags & mxForFlag;
1888 parser->flags &= ~mxForFlag;
1889 fxAssignmentExpression(parser);
1890 parser->flags |= flags;
1891 fxMatchToken(parser, XS_TOKEN_COLON);
1892 fxAssignmentExpression(parser);
1893 fxPushNodeStruct(parser, 3, XS_TOKEN_QUESTION_MARK, aLine);
1894 }
1895}
1896
1897void fxCoalesceExpression(txParser* parser)
1898{

Callers 1

fxAssignmentExpressionFunction · 0.85

Calls 6

fxCoalesceExpressionFunction · 0.85
fxCheckArrowFunctionFunction · 0.85
fxGetNextTokenFunction · 0.85
fxAssignmentExpressionFunction · 0.85
fxMatchTokenFunction · 0.85
fxPushNodeStructFunction · 0.85

Tested by

no test coverage detected