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

Function fxParametersBinding

xs/sources/xsSyntaxical.c:3831–3859  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3829}
3830
3831void fxParametersBinding(txParser* parser)
3832{
3833 txInteger aCount = 0;
3834 txInteger aLine = parser->states[0].line;
3835 txBindingNode* binding;
3836 if (parser->states[0].token == XS_TOKEN_LEFT_PARENTHESIS) {
3837 fxGetNextToken(parser);
3838 while (gxTokenFlags[parser->states[0].token] & XS_TOKEN_BEGIN_BINDING) {
3839 if (parser->states[0].token == XS_TOKEN_SPREAD) {
3840 parser->flags |= mxNotSimpleParametersFlag;
3841 fxRestBinding(parser, XS_TOKEN_ARG, 0);
3842 aCount++;
3843 break;
3844 }
3845 fxBinding(parser, XS_TOKEN_ARG, 1);
3846 binding = (txBindingNode*)parser->root;
3847 if (binding->description->token != XS_TOKEN_ARG)
3848 parser->flags |= mxNotSimpleParametersFlag;
3849 aCount++;
3850 if (parser->states[0].token != XS_TOKEN_RIGHT_PARENTHESIS)
3851 fxMatchToken(parser, XS_TOKEN_COMMA);
3852 }
3853 fxMatchToken(parser, XS_TOKEN_RIGHT_PARENTHESIS);
3854 }
3855 else
3856 fxReportParserError(parser, parser->states[0].line, "missing (");
3857 fxPushNodeList(parser, aCount);
3858 fxPushNodeStruct(parser, 1, XS_TOKEN_PARAMS_BINDING, aLine);
3859}
3860
3861txNode* fxParametersBindingFromExpressions(txParser* parser, txNode* theNode)
3862{

Callers 2

fxFunctionExpressionFunction · 0.85
fxGeneratorExpressionFunction · 0.85

Calls 7

fxGetNextTokenFunction · 0.85
fxRestBindingFunction · 0.85
fxBindingFunction · 0.85
fxMatchTokenFunction · 0.85
fxReportParserErrorFunction · 0.85
fxPushNodeListFunction · 0.85
fxPushNodeStructFunction · 0.85

Tested by

no test coverage detected