| 102 | } |
| 103 | |
| 104 | void forEachFunction ( Module * module, const char * name, const TBlock<void,FunctionPtr> & block, Context * context, LineInfoArg * lineInfo ) { |
| 105 | if ( !module ) context->throw_error_at(lineInfo, "expecting module, not null"); |
| 106 | vec4f args[1]; |
| 107 | if ( builtin_empty(name) ) { |
| 108 | auto & fnbn = module->functions; |
| 109 | context->invokeEx(block, args, nullptr, [&](SimNode * code){ |
| 110 | fnbn.foreach([&](auto fnv){ |
| 111 | args[0] = cast<FunctionPtr>::from(fnv); |
| 112 | code->eval(*context); |
| 113 | }); |
| 114 | },lineInfo); |
| 115 | } else { |
| 116 | auto & fnbn = module->functionsByName[hash64z(name)]; |
| 117 | context->invokeEx(block, args, nullptr, [&](SimNode * code){ |
| 118 | for ( auto & nv : fnbn ) { |
| 119 | args[0] = cast<FunctionPtr>::from(nv); |
| 120 | code->eval(*context); |
| 121 | } |
| 122 | },lineInfo); |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | void forEachGenericFunction ( Module * module, const char * name, const TBlock<void,FunctionPtr> & block, Context * context, LineInfoArg * lineInfo ) { |
| 127 | if ( !module ) context->throw_error_at(lineInfo, "expecting module, not null"); |
nothing calls this directly
no test coverage detected