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 9, 2024
1 parent 1375b77 commit ee0a81c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion extern/utils
Submodule utils updated 1 files
+0 −13 include/pair.hpp
4 changes: 2 additions & 2 deletions include/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ namespace riddle
* @brief Get the bounds of the arithmetic expression.
*
* @param expr The expression.
* @return utils::pair<utils::inf_rational, utils::inf_rational> The bounds.
* @return std::pair<utils::inf_rational, utils::inf_rational> The bounds.
*/
[[nodiscard]] virtual utils::pair<utils::inf_rational, utils::inf_rational> bounds(const arith_item &expr) const noexcept = 0;
[[nodiscard]] virtual std::pair<utils::inf_rational, utils::inf_rational> bounds(const arith_item &expr) const noexcept = 0;

/**
* @brief Get the domain of the expression.
Expand Down
13 changes: 6 additions & 7 deletions include/declaration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include <vector>
#include "statement.hpp"
#include "pair.hpp"

namespace riddle
{
Expand Down Expand Up @@ -145,15 +144,15 @@ namespace riddle
friend class class_declaration;

public:
constructor_declaration(std::vector<utils::pair<std::vector<id_token>, id_token>> &&params, std::vector<init_element> &&inits, std::vector<std::unique_ptr<statement>> &&stmts) : parameters(std::move(params)), inits(std::move(inits)), body(std::move(stmts)) {}
constructor_declaration(std::vector<std::pair<std::vector<id_token>, id_token>> &&params, std::vector<init_element> &&inits, std::vector<std::unique_ptr<statement>> &&stmts) : parameters(std::move(params)), inits(std::move(inits)), body(std::move(stmts)) {}

std::string to_string() const { return ""; }

private:
void refine(scope &scp) const;

private:
std::vector<utils::pair<std::vector<id_token>, id_token>> parameters; // the parameters of the constructor..
std::vector<std::pair<std::vector<id_token>, id_token>> parameters; // the parameters of the constructor..
std::vector<init_element> inits; // the initializations of the fields..
std::vector<std::unique_ptr<statement>> body; // the body of the constructor..
};
Expand All @@ -164,7 +163,7 @@ namespace riddle
friend class compilation_unit;

public:
method_declaration(std::vector<id_token> &&rt, const id_token &&name, std::vector<utils::pair<std::vector<id_token>, id_token>> &&params, std::vector<std::unique_ptr<statement>> &&stmts) : return_type(std::move(rt)), name(std::move(name)), parameters(std::move(params)), body(std::move(stmts)) {}
method_declaration(std::vector<id_token> &&rt, const id_token &&name, std::vector<std::pair<std::vector<id_token>, id_token>> &&params, std::vector<std::unique_ptr<statement>> &&stmts) : return_type(std::move(rt)), name(std::move(name)), parameters(std::move(params)), body(std::move(stmts)) {}

std::string to_string() const
{
Expand Down Expand Up @@ -194,7 +193,7 @@ namespace riddle
private:
std::vector<id_token> return_type; // the return type of the method..
id_token name; // the name of the method..
std::vector<utils::pair<std::vector<id_token>, id_token>> parameters; // the parameters of the method..
std::vector<std::pair<std::vector<id_token>, id_token>> parameters; // the parameters of the method..
std::vector<std::unique_ptr<statement>> body; // the body of the method..
};

Expand All @@ -204,7 +203,7 @@ namespace riddle
friend class compilation_unit;

public:
predicate_declaration(const id_token &&name, std::vector<utils::pair<std::vector<id_token>, id_token>> &&params, std::vector<std::vector<id_token>> &&base_predicates, std::vector<std::unique_ptr<statement>> &&stmts) : name(std::move(name)), parameters(std::move(params)), base_predicates(std::move(base_predicates)), body(std::move(stmts)) {}
predicate_declaration(const id_token &&name, std::vector<std::pair<std::vector<id_token>, id_token>> &&params, std::vector<std::vector<id_token>> &&base_predicates, std::vector<std::unique_ptr<statement>> &&stmts) : name(std::move(name)), parameters(std::move(params)), base_predicates(std::move(base_predicates)), body(std::move(stmts)) {}

std::string to_string() const
{
Expand Down Expand Up @@ -240,7 +239,7 @@ namespace riddle

private:
id_token name; // the name of the class..
std::vector<utils::pair<std::vector<id_token>, id_token>> parameters; // the type parameters of the class..
std::vector<std::pair<std::vector<id_token>, id_token>> parameters; // the type parameters of the class..
std::vector<std::vector<id_token>> base_predicates; // the base predicates of the class..
std::vector<std::unique_ptr<statement>> body; // the body of the rule..
};
Expand Down
8 changes: 4 additions & 4 deletions src/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ namespace riddle

if (constructors.empty())
{
std::vector<utils::pair<std::vector<id_token>, id_token>> parameters; // the parameters of the constructor..
std::vector<std::pair<std::vector<id_token>, id_token>> parameters; // the parameters of the constructor..
std::vector<init_element> inits; // the initializations of the fields..
std::vector<std::unique_ptr<statement>> body; // the body of the constructor..
constructors.emplace_back(std::make_unique<constructor_declaration>(std::move(parameters), std::move(inits), std::move(body)));
Expand Down Expand Up @@ -373,7 +373,7 @@ namespace riddle
std::unique_ptr<method_declaration> parser::parse_method_declaration()
{
std::vector<id_token> rt;
std::vector<utils::pair<std::vector<id_token>, id_token>> params;
std::vector<std::pair<std::vector<id_token>, id_token>> params;
std::vector<std::unique_ptr<statement>> stmts;

switch (tk->sym)
Expand Down Expand Up @@ -458,7 +458,7 @@ namespace riddle
}
std::unique_ptr<constructor_declaration> parser::parse_constructor_declaration()
{
std::vector<utils::pair<std::vector<id_token>, id_token>> parameters; // the parameters of the constructor..
std::vector<std::pair<std::vector<id_token>, id_token>> parameters; // the parameters of the constructor..
std::vector<init_element> inits; // the initializations of the fields..
std::vector<std::unique_ptr<statement>> body; // the body of the constructor..

Expand Down Expand Up @@ -543,7 +543,7 @@ namespace riddle
}
std::unique_ptr<predicate_declaration> parser::parse_predicate_declaration()
{
std::vector<utils::pair<std::vector<id_token>, id_token>> params;
std::vector<std::pair<std::vector<id_token>, id_token>> params;
std::vector<std::vector<id_token>> base_predicates;
std::vector<std::unique_ptr<statement>> stmts;

Expand Down

0 comments on commit ee0a81c

Please sign in to comment.