Skip to content

Commit

Permalink
Update extern/utils subproject commit
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardodebenedictis committed Apr 22, 2024
1 parent 28e6acc commit 1a3f47a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion extern/utils
2 changes: 1 addition & 1 deletion include/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace riddle
* @param value The value of the int expression.
* @return std::shared_ptr<arith_item> The int expression.
*/
[[nodiscard]] std::shared_ptr<arith_item> new_int(INTEGER_TYPE value);
[[nodiscard]] std::shared_ptr<arith_item> new_int(INT_TYPE value);

/**
* @brief Create a new real expression.
Expand Down
8 changes: 4 additions & 4 deletions include/lexer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ namespace riddle
class int_token final : public token
{
public:
int_token(const INTEGER_TYPE &val, const size_t &start_line, const size_t &start_pos, const size_t &end_line, const size_t &end_pos) : token(IntLiteral_ID, start_line, start_pos, end_line, end_pos), val(val) {}
int_token(const INT_TYPE &val, const size_t &start_line, const size_t &start_pos, const size_t &end_line, const size_t &end_pos) : token(IntLiteral_ID, start_line, start_pos, end_line, end_pos), val(val) {}

std::string to_string() const override { return std::to_string(val); }

const INTEGER_TYPE val;
const INT_TYPE val;
};

class real_token final : public token
Expand Down Expand Up @@ -276,15 +276,15 @@ namespace riddle

std::unique_ptr<token> make_int_token(const std::string &str)
{
auto tkn = std::make_unique<int_token>(static_cast<INTEGER_TYPE>(std::stol(str)), start_line, start_pos, end_line, end_pos);
auto tkn = std::make_unique<int_token>(static_cast<INT_TYPE>(std::stol(str)), start_line, start_pos, end_line, end_pos);
start_line = end_line;
start_pos = end_pos;
return tkn;
}

std::unique_ptr<token> make_real_token(const std::string &intgr, const std::string &dec)
{
auto tkn = std::make_unique<real_token>(utils::rational(static_cast<INTEGER_TYPE>(std::stol(intgr + dec)), static_cast<INTEGER_TYPE>(std::pow(10, dec.size()))), start_line, start_pos, end_line, end_pos);
auto tkn = std::make_unique<real_token>(utils::rational(static_cast<INT_TYPE>(std::stol(intgr + dec)), static_cast<INT_TYPE>(std::pow(10, dec.size()))), start_line, start_pos, end_line, end_pos);
start_line = end_line;
start_pos = end_pos;
return tkn;
Expand Down
2 changes: 1 addition & 1 deletion src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ 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_int(INT_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)); }

Expand Down

0 comments on commit 1a3f47a

Please sign in to comment.