Skip to content

Commit

Permalink
Add new data types and functions
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardodebenedictis committed Mar 27, 2024
1 parent feee714 commit 5470797
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ namespace riddle

std::shared_ptr<bool_item> core::new_bool(bool value) { return std::make_shared<bool_item>(bool_tp, value ? utils::TRUE_lit : utils::FALSE_lit); }

std::shared_ptr<arith_item> core::new_int(INTEGER_TYPE value) { return std::make_shared<arith_item>(int_tp, utils::lin(utils::rational(value))); }
std::shared_ptr<arith_item> core::new_real(const utils::rational &value) { return std::make_shared<arith_item>(real_tp, utils::lin(value)); }
std::shared_ptr<arith_item> core::new_time(const utils::rational &value) { return std::make_shared<arith_item>(time_tp, utils::lin(value)); }

std::shared_ptr<string_item> core::new_string(const std::string &value) { return std::make_shared<string_item>(string_tp, value); }

std::shared_ptr<component> core::new_item(component_type &tp) { return std::make_shared<component>(tp); }

std::optional<std::reference_wrapper<field>> core::get_field(const std::string &name) const noexcept
Expand Down

0 comments on commit 5470797

Please sign in to comment.