diff options
Diffstat (limited to 'tdtl/td/tl/tl_simple.h')
| -rw-r--r-- | tdtl/td/tl/tl_simple.h | 6 |
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); |
