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

Function fxExportBinding

xs/sources/xsSyntaxical.c:956–994  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

954}
955
956void fxExportBinding(txParser* parser, txNode* node)
957{
958 txToken token = node->description->token;
959 if ((token == XS_TOKEN_CONST) || (token == XS_TOKEN_LET) || (token == XS_TOKEN_VAR)) {
960 fxPushSymbol(parser, ((txDeclareNode*)node)->symbol);
961 fxPushNULL(parser);
962 fxPushNodeStruct(parser, 2, XS_TOKEN_SPECIFIER, node->line);
963 }
964 else if (token == XS_TOKEN_BINDING) {
965 fxExportBinding(parser, ((txBindingNode*)node)->target);
966 }
967 else if (token == XS_TOKEN_ARRAY_BINDING) {
968 node = ((txArrayBindingNode*)node)->items->first;
969 while (node) {
970 fxExportBinding(parser, node);
971 node = node->next;
972 }
973 }
974 else if (token == XS_TOKEN_OBJECT_BINDING) {
975 node = ((txObjectBindingNode*)node)->items->first;
976 while (node) {
977 fxExportBinding(parser, node);
978 node = node->next;
979 }
980 }
981 else if (token == XS_TOKEN_PROPERTY_BINDING)
982 fxExportBinding(parser, ((txPropertyBindingNode*)node)->binding);
983 else if (token == XS_TOKEN_PROPERTY_BINDING_AT)
984 fxExportBinding(parser, ((txPropertyBindingAtNode*)node)->binding);
985 else if (token == XS_TOKEN_REST_BINDING)
986 fxExportBinding(parser, ((txRestBindingNode*)node)->binding);
987 else if (token == XS_TOKEN_STATEMENTS) {
988 node = ((txStatementsNode*)node)->items->first;
989 while (node) {
990 fxExportBinding(parser, node);
991 node = node->next;
992 }
993 }
994}
995
996
997void fxImportDeclaration(txParser* parser)

Callers 1

fxExportDeclarationFunction · 0.85

Calls 3

fxPushSymbolFunction · 0.85
fxPushNULLFunction · 0.85
fxPushNodeStructFunction · 0.85

Tested by

no test coverage detected