MCPcopy Create free account
hub / github.com/covscript/covscript / call_vv

Method call_vv

sources/instance/statement.cpp:65–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 }
64
65 var function::call_vv(const function *_this, vector &args)
66 {
67 current_process->poll_event();
68 scope_guard scope(_this->mContext);
69#ifdef CS_DEBUGGER
70 fcall_guard fcall(_this->mDecl);
71 if (_this->mMatch)
72 cs_debugger_func_callback(_this->mDecl, _this->mStmt);
73#else
74 fcall_guard fcall;
75#endif
76 {
77 var arg_list = var::make<cs::array>();
78 auto &arr = arg_list.val<cs::array>();
79 std::size_t i = 0;
80 if (_this->mIsMemFn)
81 _this->mContext->instance->storage.add_var_no_return("this", args[i++]);
82 else if (_this->mIsLambda)
83 _this->mContext->instance->storage.add_var_no_return("self", args[i++]);
84 for (; i < args.size(); ++i)
85 arr.push_back(args[i]);
86 _this->mContext->instance->storage.add_var_no_return(_this->mArgs.front().data(), arg_list);
87 }
88 for (auto &ptr : _this->mBody) {
89 try {
90 ptr->run();
91 }
92 catch (const cs::exception &e) {
93 throw e;
94 }
95 catch (const std::exception &e) {
96 throw exception(ptr->get_line_num(), ptr->get_file_path(), ptr->get_raw_code(), e.what());
97 }
98 if (_this->mContext->instance->return_fcall) {
99 _this->mContext->instance->return_fcall = false;
100 return fcall.get();
101 }
102 }
103 return fcall.get();
104 }
105
106 var function::call_rl(const function *_this, vector &args)
107 {

Callers

nothing calls this directly

Calls 10

poll_eventMethod · 0.80
add_var_no_returnMethod · 0.80
sizeMethod · 0.80
dataMethod · 0.80
exceptionFunction · 0.70
runMethod · 0.45
get_line_numMethod · 0.45
whatMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected