aboutsummaryrefslogtreecommitdiffhomepage
path: root/tdtl
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2019-12-08 10:44:41 +0300
committerlevlam <levlam@telegram.org>2019-12-08 10:44:41 +0300
commit95bee165231fd789124ff23e9f4d2a89069c99dd (patch)
tree16011d983d11a89877a10923d5c91aa38959f140 /tdtl
parent8c495d99e67659794683df8399848a3af2ca51e6 (diff)
Simplify td_api_json more.
GitOrigin-RevId: 4df61a045e381a4577321c87a2b393747992127e
Diffstat (limited to 'tdtl')
-rw-r--r--tdtl/td/tl/tl_simple.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/tdtl/td/tl/tl_simple.h b/tdtl/td/tl/tl_simple.h
index ea53a0620..b7d99cd31 100644
--- a/tdtl/td/tl/tl_simple.h
+++ b/tdtl/td/tl/tl_simple.h
@@ -21,7 +21,6 @@
namespace td {
namespace tl {
namespace simple {
-// TL type is
std::string gen_cpp_name(std::string name) {
for (std::size_t i = 0; i < name.size(); i++) {
@@ -132,9 +131,11 @@ class Schema {
void mark_result(const Type *type) {
do_mark(type, true);
}
+
void mark_query(const Type *type) {
do_mark(type, false);
}
+
void do_mark(const Type *type, bool is_result) {
if (type->type == Type::Vector) {
return do_mark(type->vector_value_type, is_result);
@@ -190,6 +191,7 @@ class Schema {
}
return type;
}
+
const CustomType *get_custom_type(const tl_type *from_type) {
auto *type = get_type(from_type);
assert(type->type == Type::Custom);
@@ -213,6 +215,7 @@ class Schema {
}
return constructor;
}
+
const Function *get_function(const tl_combinator *from) {
auto &function = function_by_id[from->id];
if (!function) {
@@ -230,6 +233,7 @@ class Schema {
}
return function;
}
+
const Type *get_type(const tl_tree *tree) {
assert(tree->get_type() == NODE_TYPE_TYPE);
auto *type_tree = static_cast<const tl_tree_type *>(tree);