some renamings for clarity and consistency

This commit is contained in:
2026-03-08 19:27:52 +01:00
parent 86c8a11074
commit 21fc06173e
7 changed files with 80 additions and 80 deletions
+19 -19
View File
@@ -8,25 +8,25 @@
namespace matador::rsql {
enum class binary_operator {
EQUALS,
NOT_EQUALS,
GREATER_THAN,
GREATER_THAN_OR_EQUAL,
LESS_THAN,
LESS_THAN_OR_EQUAL,
Equals,
NotEquals,
GreaterThan,
GreaterThanOrEqual,
LessThan,
LessThanOrEqual,
};
static const std::map<std::string, binary_operator> binary_operators = {
{ "==", binary_operator::EQUALS },
{ "!=", binary_operator::NOT_EQUALS },
{ ">", binary_operator::GREATER_THAN },
{ "=gt*", binary_operator::GREATER_THAN },
{ ">=", binary_operator::GREATER_THAN_OR_EQUAL },
{ "=ge=", binary_operator::GREATER_THAN_OR_EQUAL },
{ "<", binary_operator::LESS_THAN },
{ "=lt=", binary_operator::LESS_THAN },
{ "<=", binary_operator::LESS_THAN_OR_EQUAL },
{ "=le=", binary_operator::LESS_THAN_OR_EQUAL }
{ "==", binary_operator::Equals },
{ "!=", binary_operator::NotEquals },
{ ">", binary_operator::GreaterThan },
{ "=gt*", binary_operator::GreaterThan },
{ ">=", binary_operator::GreaterThanOrEqual },
{ "=ge=", binary_operator::GreaterThanOrEqual },
{ "<", binary_operator::LessThan },
{ "=lt=", binary_operator::LessThan },
{ "<=", binary_operator::LessThanOrEqual },
{ "=le=", binary_operator::LessThanOrEqual }
};
class node_visitor;
@@ -36,9 +36,9 @@ public:
void accept(node_visitor& visitor) const override;
const std::string& field() const;
binary_operator operand() const;
const std::string& value() const;
[[nodiscard]] const std::string& field() const;
[[nodiscard]] binary_operator operand() const;
[[nodiscard]] const std::string& value() const;
private:
std::string field_;
@@ -9,13 +9,13 @@
namespace matador::rsql {
enum class collection_operator {
IN,
OUT
In,
Out
};
static const std::map<std::string, collection_operator> collection_operators = {
{ "=in=", collection_operator::IN },
{ "=out=", collection_operator::OUT }
{ "=in=", collection_operator::In },
{ "=out=", collection_operator::Out }
};
@@ -25,9 +25,9 @@ public:
void accept(node_visitor& visitor) const override;
const std::string& field() const;
collection_operator operand() const;
const std::vector<std::string>& values() const;
[[nodiscard]] const std::string& field() const;
[[nodiscard]] collection_operator operand() const;
[[nodiscard]] const std::vector<std::string>& values() const;
private:
std::string field_;
+4 -4
View File
@@ -9,8 +9,8 @@
namespace matador::rsql {
enum class logical_operator {
AND,
OR,
And,
Or,
};
class node_visitor;
@@ -20,8 +20,8 @@ public:
explicit logical_node(logical_operator op);
void accept(node_visitor& visitor) const override;
const std::vector<std::shared_ptr<node>>& children() const;
logical_operator operand() const;
[[nodiscard]] const std::vector<std::shared_ptr<node>>& children() const;
[[nodiscard]] logical_operator operand() const;
private:
friend class parser;
+8 -8
View File
@@ -3,14 +3,14 @@
namespace matador::rsql {
enum class token_type {
IDENTIFIER,
OPERATOR,
VALUE,
LOGICAL_AND,
LOGICAL_OR,
OPEN_PAREN,
CLOSE_PAREN,
UNKNOWN
Identifier,
Operator,
Value,
LogicalAnd,
LogicalOr,
OpenParen,
CloseParen,
Unknown
};
}