Skip to content
Snippets Groups Projects
Commit a5635de3 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Fix a few naming issues

parent 62b80fe4
No related branches found
No related tags found
1 merge request!37Feature/language
...@@ -65,7 +65,7 @@ class AffectationExecutor final : public IAffectationExecutor ...@@ -65,7 +65,7 @@ class AffectationExecutor final : public IAffectationExecutor
private: private:
ValueT& m_lhs; ValueT& m_lhs;
static inline const bool _is_defined{[] { static inline const bool m_is_defined{[] {
if constexpr (std::is_same_v<std::decay_t<ValueT>, bool>) { if constexpr (std::is_same_v<std::decay_t<ValueT>, bool>) {
if constexpr (not std::is_same_v<OperatorT, language::eq_op>) { if constexpr (not std::is_same_v<OperatorT, language::eq_op>) {
return false; return false;
...@@ -78,7 +78,7 @@ class AffectationExecutor final : public IAffectationExecutor ...@@ -78,7 +78,7 @@ class AffectationExecutor final : public IAffectationExecutor
AffectationExecutor(ASTNode& node, ValueT& lhs) : m_lhs(lhs) AffectationExecutor(ASTNode& node, ValueT& lhs) : m_lhs(lhs)
{ {
// LCOV_EXCL_START // LCOV_EXCL_START
if constexpr (not _is_defined) { if constexpr (not m_is_defined) {
throw parse_error("unexpected error: invalid operands to affectation expression", std::vector{node.begin()}); throw parse_error("unexpected error: invalid operands to affectation expression", std::vector{node.begin()});
} }
// LCOV_EXCL_STOP // LCOV_EXCL_STOP
...@@ -87,7 +87,7 @@ class AffectationExecutor final : public IAffectationExecutor ...@@ -87,7 +87,7 @@ class AffectationExecutor final : public IAffectationExecutor
PUGS_INLINE void PUGS_INLINE void
affect(ExecutionPolicy&, DataVariant&& rhs) affect(ExecutionPolicy&, DataVariant&& rhs)
{ {
if constexpr (_is_defined) { if constexpr (m_is_defined) {
if constexpr (not std::is_same_v<DataT, ZeroType>) { if constexpr (not std::is_same_v<DataT, ZeroType>) {
if constexpr (std::is_same_v<ValueT, std::string>) { if constexpr (std::is_same_v<ValueT, std::string>) {
if constexpr (std::is_same_v<OperatorT, language::eq_op>) { if constexpr (std::is_same_v<OperatorT, language::eq_op>) {
...@@ -138,7 +138,7 @@ class ComponentAffectationExecutor final : public IAffectationExecutor ...@@ -138,7 +138,7 @@ class ComponentAffectationExecutor final : public IAffectationExecutor
ArrayT& m_lhs_array; ArrayT& m_lhs_array;
ASTNode& m_index_expression; ASTNode& m_index_expression;
static inline const bool _is_defined{[] { static inline const bool m_is_defined{[] {
if constexpr (not std::is_same_v<typename ArrayT::data_type, ValueT>) { if constexpr (not std::is_same_v<typename ArrayT::data_type, ValueT>) {
return false; return false;
} else if constexpr (std::is_same_v<std::decay_t<ValueT>, bool>) { } else if constexpr (std::is_same_v<std::decay_t<ValueT>, bool>) {
...@@ -154,7 +154,7 @@ class ComponentAffectationExecutor final : public IAffectationExecutor ...@@ -154,7 +154,7 @@ class ComponentAffectationExecutor final : public IAffectationExecutor
: m_lhs_array{lhs_array}, m_index_expression{index_expression} : m_lhs_array{lhs_array}, m_index_expression{index_expression}
{ {
// LCOV_EXCL_START // LCOV_EXCL_START
if constexpr (not _is_defined) { if constexpr (not m_is_defined) {
throw parse_error("unexpected error: invalid operands to affectation expression", std::vector{node.begin()}); throw parse_error("unexpected error: invalid operands to affectation expression", std::vector{node.begin()});
} }
// LCOV_EXCL_STOP // LCOV_EXCL_STOP
...@@ -163,7 +163,7 @@ class ComponentAffectationExecutor final : public IAffectationExecutor ...@@ -163,7 +163,7 @@ class ComponentAffectationExecutor final : public IAffectationExecutor
PUGS_INLINE void PUGS_INLINE void
affect(ExecutionPolicy& exec_policy, DataVariant&& rhs) affect(ExecutionPolicy& exec_policy, DataVariant&& rhs)
{ {
if constexpr (_is_defined) { if constexpr (m_is_defined) {
const int64_t index_value = [&](DataVariant&& value_variant) -> int64_t { const int64_t index_value = [&](DataVariant&& value_variant) -> int64_t {
int64_t index_value = 0; int64_t index_value = 0;
std::visit( std::visit(
......
...@@ -187,7 +187,7 @@ class BinaryExpressionProcessor final : public INodeProcessor ...@@ -187,7 +187,7 @@ class BinaryExpressionProcessor final : public INodeProcessor
} }
} }
static inline const bool _is_defined{[] { static inline const bool m_is_defined{[] {
if constexpr (std::is_same_v<BinaryOpT, language::xor_op>) { if constexpr (std::is_same_v<BinaryOpT, language::xor_op>) {
return std::is_same_v<std::decay_t<A_DataT>, std::decay_t<B_DataT>> and std::is_integral_v<std::decay_t<A_DataT>>; return std::is_same_v<std::decay_t<A_DataT>, std::decay_t<B_DataT>> and std::is_integral_v<std::decay_t<A_DataT>>;
} }
...@@ -198,7 +198,7 @@ class BinaryExpressionProcessor final : public INodeProcessor ...@@ -198,7 +198,7 @@ class BinaryExpressionProcessor final : public INodeProcessor
DataVariant DataVariant
execute(ExecutionPolicy& exec_policy) execute(ExecutionPolicy& exec_policy)
{ {
if constexpr (_is_defined) { if constexpr (m_is_defined) {
return this->_eval(m_node.children[0]->execute(exec_policy), m_node.children[1]->execute(exec_policy)); return this->_eval(m_node.children[0]->execute(exec_policy), m_node.children[1]->execute(exec_policy));
} else { } else {
return {}; // LCOV_EXCL_LINE return {}; // LCOV_EXCL_LINE
...@@ -207,7 +207,7 @@ class BinaryExpressionProcessor final : public INodeProcessor ...@@ -207,7 +207,7 @@ class BinaryExpressionProcessor final : public INodeProcessor
BinaryExpressionProcessor(ASTNode& node) : m_node{node} BinaryExpressionProcessor(ASTNode& node) : m_node{node}
{ {
if constexpr (not _is_defined) { if constexpr (not m_is_defined) {
// LCOV_EXCL_START // LCOV_EXCL_START
throw parse_error("invalid operands to binary expression", std::vector{m_node.begin()}); throw parse_error("invalid operands to binary expression", std::vector{m_node.begin()});
// LCOV_EXCL_STOP // LCOV_EXCL_STOP
......
...@@ -12,16 +12,16 @@ ...@@ -12,16 +12,16 @@
class BuiltinFunctionExpressionProcessor final : public INodeProcessor class BuiltinFunctionExpressionProcessor final : public INodeProcessor
{ {
private: private:
std::shared_ptr<IBuiltinFunctionEmbedder> m_embedded_; std::shared_ptr<IBuiltinFunctionEmbedder> m_embedded;
public: public:
DataVariant DataVariant
execute(ExecutionPolicy& exec_policy) execute(ExecutionPolicy& exec_policy)
{ {
return m_embedded_->apply(exec_policy.currentContext().values()); return m_embedded->apply(exec_policy.currentContext().values());
} }
BuiltinFunctionExpressionProcessor(std::shared_ptr<IBuiltinFunctionEmbedder> embedded_) : m_embedded_(embedded_) {} BuiltinFunctionExpressionProcessor(std::shared_ptr<IBuiltinFunctionEmbedder> embedded) : m_embedded(embedded) {}
}; };
class BuiltinFunctionProcessor : public INodeProcessor class BuiltinFunctionProcessor : public INodeProcessor
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment