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

Function fxArrayBindingFromExpression

xs/sources/xsSyntaxical.c:3639–3683  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3637}
3638
3639txNode* fxArrayBindingFromExpression(txParser* parser, txNode* theNode, txToken theToken)
3640{
3641 txNodeList* list = ((txArrayNode*)theNode)->items;
3642 txNode** address = &(list->first);
3643 txNode* item;
3644 txNode* binding;
3645 while ((item = *address)) {
3646 if (!item->description) {
3647 parser->errorSymbol = parser->SyntaxErrorSymbol;
3648 return NULL;
3649 }
3650 if (item->description->token == XS_TOKEN_SPREAD) {
3651 if (theNode->flags & mxElisionFlag) {
3652 parser->errorSymbol = parser->SyntaxErrorSymbol;
3653 return NULL;
3654 }
3655 binding = fxRestBindingFromExpression(parser, item, theToken, 0);
3656 if (!binding) {
3657 parser->errorSymbol = parser->SyntaxErrorSymbol;
3658 return NULL;
3659 }
3660 break;
3661 }
3662 if (item->description->token == XS_TOKEN_ELISION) {
3663 item->description = &gxTokenDescriptions[XS_TOKEN_SKIP_BINDING];
3664 }
3665 else {
3666// if ((theToken == XS_TOKEN_BINDING) && ((item->description->token== XS_TOKEN_MEMBER) || (item->description->token == XS_TOKEN_MEMBER_AT)))
3667// binding = item;
3668// else {
3669 binding = fxBindingFromExpression(parser, item, theToken);
3670 if (!binding) {
3671 parser->errorSymbol = parser->SyntaxErrorSymbol;
3672 return NULL;
3673 }
3674 binding->next = item->next;
3675 item = *address = binding;
3676// }
3677 }
3678 address = &(item->next);
3679 }
3680 fxPushNode(parser, (txNode*)list);
3681 fxPushNodeStruct(parser, 1, XS_TOKEN_ARRAY_BINDING, theNode->line);
3682 return fxPopNode(parser);
3683}
3684
3685txUnsigned fxObjectBinding(txParser* parser, txToken theToken)
3686{

Callers 2

fxBindingFromExpressionFunction · 0.85
fxCheckReferenceFunction · 0.85

Calls 5

fxBindingFromExpressionFunction · 0.85
fxPushNodeFunction · 0.85
fxPushNodeStructFunction · 0.85
fxPopNodeFunction · 0.85

Tested by

no test coverage detected