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

Method call_rl

sources/instance/statement.cpp:106–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104 }
105
106 var function::call_rl(const function *_this, vector &args)
107 {
108 current_process->poll_event();
109 if (args.size() != _this->mArgs.size())
110 throw runtime_error(
111 "Wrong size of arguments. Expected " + std::to_string(_this->mArgs.size()) + ", provided " +
112 std::to_string(args.size()));
113 scope_guard scope(_this->mContext);
114#ifdef CS_DEBUGGER
115 fcall_guard fcall(_this->mDecl);
116 if (_this->mMatch)
117 cs_debugger_func_callback(_this->mDecl, _this->mStmt);
118#endif
119 for (std::size_t i = 0; i < args.size(); ++i)
120 _this->mContext->instance->storage.add_var_no_return(_this->mArgs[i].data(), args[i]);
121 try {
122 return _this->mContext->instance->parse_expr(static_cast<const statement_return *>(_this->mBody.front())->get_tree().root());
123 }
124 catch (const cs::exception &e) {
125 throw e;
126 }
127 catch (const std::exception &e) {
128 const statement_base *ptr = _this->mBody.front();
129 throw exception(ptr->get_line_num(), ptr->get_file_path(), ptr->get_raw_code(), e.what());
130 }
131 }
132
133 var function::call_el(const function *_this, vector &args)
134 {

Callers

nothing calls this directly

Calls 12

runtime_errorClass · 0.85
poll_eventMethod · 0.80
sizeMethod · 0.80
add_var_no_returnMethod · 0.80
dataMethod · 0.80
parse_exprMethod · 0.80
exceptionFunction · 0.70
to_stringFunction · 0.50
rootMethod · 0.45
get_line_numMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected