MCPcopy Create free account
hub / github.com/TelegramMessenger/cocoon / gen_function_vars

Method gen_function_vars

tl/generate/tl_writer_java.cpp:278–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278std::string TD_TL_writer_java::gen_function_vars(const tl::tl_combinator *t,
279 std::vector<tl::var_description> &vars) const {
280 for (std::size_t i = 0; i < vars.size(); i++) {
281 vars[i].index = static_cast<int>(i);
282 vars[i].is_stored = false;
283 vars[i].is_type = false;
284 vars[i].parameter_num = -1;
285 vars[i].function_arg_num = -1;
286 }
287
288 for (std::size_t i = 0; i < t->args.size(); i++) {
289 const tl::arg &a = t->args[i];
290
291 int arg_type = a.type->get_type();
292 if (arg_type == tl::NODE_TYPE_VAR_TYPE) {
293 const tl::tl_tree_var_type *var_type = static_cast<const tl::tl_tree_var_type *>(a.type);
294 assert(a.flags & tl::FLAG_EXCL);
295 assert(var_type->var_num >= 0);
296 assert(!vars[var_type->var_num].is_type);
297 vars[var_type->var_num].is_type = true;
298 vars[var_type->var_num].function_arg_num = static_cast<int>(i);
299 }
300 }
301
302 return "";
303}
304
305std::string TD_TL_writer_java::gen_uni(const tl::tl_tree_type *result_type, std::vector<tl::var_description> &vars,
306 bool check_negative) const {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected