diff --git a/apps/math_toolbox.cpp b/apps/math_toolbox.cpp index 9e25d0c28..85e1a688f 100644 --- a/apps/math_toolbox.cpp +++ b/apps/math_toolbox.cpp @@ -86,8 +86,6 @@ const ToolboxMessageTree vectorsChildren[] = { const ToolboxMessageTree logicExplicitChildren[] = { ToolboxMessageTree::Leaf(I18n::Message::LogicalNotExplicitCommandWithArg, I18n::Message::LogicalNot), - ToolboxMessageTree::Leaf(I18n::Message::LogicalShiftLeftExplicitCommandWithArg, I18n::Message::LogicalShiftLeft), - ToolboxMessageTree::Leaf(I18n::Message::LogicalShiftRightExplicitCommandWithArg, I18n::Message::LogicalShiftRight), ToolboxMessageTree::Leaf(I18n::Message::LogicalShiftRightArithmeticExplicitCommandWithArg, I18n::Message::LogicalShiftRightArithmetic), ToolboxMessageTree::Leaf(I18n::Message::LogicalRotateLeftExplicitCommandWithArg, I18n::Message::LogicalRotateLeft), ToolboxMessageTree::Leaf(I18n::Message::LogicalRotateRightExplicitCommandWithArg, I18n::Message::LogicalRotateRight), diff --git a/apps/shared.universal.i18n b/apps/shared.universal.i18n index 5eb42a2c8..08a516ff5 100644 --- a/apps/shared.universal.i18n +++ b/apps/shared.universal.i18n @@ -499,11 +499,9 @@ LogicalNotExplicitCommandWithArg = "not(a,n)" LogicalOr = "a OR b" LogicalOrCommandWithArg = "or(a,b)" LogicalShiftLeftCommandWithArg = "sll(a,s)" -LogicalShiftLeftExplicitCommandWithArg = "sll(a,s,n)" LogicalShiftRightArithmeticCommandWithArg = "sra(a,s)" LogicalShiftRightArithmeticExplicitCommandWithArg = "sra(a,s,n)" LogicalShiftRightCommandWithArg = "srl(a,s)" -LogicalShiftRightExplicitCommandWithArg = "srl(a,s,n)" LogicalRotateLeftCommandWithArg = "rol(a,r)" LogicalRotateLeftExplicitCommandWithArg = "rol(a,r,n)" LogicalRotateRightCommandWithArg = "ror(a,r)" diff --git a/poincare/include/poincare/binary_operation.h b/poincare/include/poincare/binary_operation.h index 9cbe8a2b1..b99da0cf4 100644 --- a/poincare/include/poincare/binary_operation.h +++ b/poincare/include/poincare/binary_operation.h @@ -140,13 +140,6 @@ namespace Poincare Expression shallowReduce(ExpressionNode::ReductionContext reductionContext); }; - class ShiftLogicLeftExplicit final : public Expression { - public: - ShiftLogicLeftExplicit(const BinaryOperationNode<22> *n) : Expression(n) {} - static ShiftLogicLeftExplicit Builder(Expression child1, Expression child2, Expression child3) { return TreeHandle::FixedArityBuilder >({child1, child2, child3}); } - static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("sll", 3, &UntypedBuilderThreeChildren); - Expression shallowReduce(ExpressionNode::ReductionContext reductionContext); - }; class ShiftLogicRight final : public Expression { public: @@ -156,14 +149,6 @@ namespace Poincare Expression shallowReduce(ExpressionNode::ReductionContext reductionContext); }; - class ShiftLogicRightExplicit final : public Expression { - public: - ShiftLogicRightExplicit(const BinaryOperationNode<24> *n) : Expression(n) {} - static ShiftLogicRightExplicit Builder(Expression child1, Expression child2, Expression child3) { return TreeHandle::FixedArityBuilder >({child1, child2, child3}); } - static constexpr Expression::FunctionHelper s_functionHelper = Expression::FunctionHelper("srl", 3, &UntypedBuilderThreeChildren); - Expression shallowReduce(ExpressionNode::ReductionContext reductionContext); - }; - class ShiftArithmeticRight final : public Expression { public: ShiftArithmeticRight(const BinaryOperationNode<25> *n) : Expression(n) {} diff --git a/poincare/include/poincare/expression.h b/poincare/include/poincare/expression.h index fb8887982..2f0361c90 100644 --- a/poincare/include/poincare/expression.h +++ b/poincare/include/poincare/expression.h @@ -108,9 +108,7 @@ class Expression : public TreeHandle { friend class ShiftArithmeticRight; friend class ShiftArithmeticRightExplicit; friend class ShiftLogicLeft; - friend class ShiftLogicLeftExplicit; friend class ShiftLogicRight; - friend class ShiftLogicRightExplicit; friend class SignFunction; friend class Sine; friend class SquareRoot; diff --git a/poincare/include/poincare/expression_node.h b/poincare/include/poincare/expression_node.h index fe9be018f..1f94a2fc3 100644 --- a/poincare/include/poincare/expression_node.h +++ b/poincare/include/poincare/expression_node.h @@ -115,9 +115,7 @@ public: ShiftArithmeticRight, ShiftArithmeticRightExplicit, ShiftLogicLeft, - ShiftLogicLeftExplicit, ShiftLogicRight, - ShiftLogicRightExplicit, SignFunction, SquareRoot, Subtraction, diff --git a/poincare/src/binary_operation.cpp b/poincare/src/binary_operation.cpp index f85683bb3..02bd1f6b1 100644 --- a/poincare/src/binary_operation.cpp +++ b/poincare/src/binary_operation.cpp @@ -20,9 +20,7 @@ namespace Poincare { constexpr Expression::FunctionHelper BitsClear::s_functionHelper; constexpr Expression::FunctionHelper BitsClearExplicit::s_functionHelper; constexpr Expression::FunctionHelper ShiftLogicLeft::s_functionHelper; - constexpr Expression::FunctionHelper ShiftLogicLeftExplicit::s_functionHelper; constexpr Expression::FunctionHelper ShiftLogicRight::s_functionHelper; - constexpr Expression::FunctionHelper ShiftLogicRightExplicit::s_functionHelper; constexpr Expression::FunctionHelper ShiftArithmeticRight::s_functionHelper; constexpr Expression::FunctionHelper ShiftArithmeticRightExplicit::s_functionHelper; constexpr Expression::FunctionHelper RotateLeft::s_functionHelper; @@ -44,9 +42,7 @@ namespace Poincare { template<> int BinaryOperationNode<19>::numberOfChildren() const { return BitsClear::s_functionHelper.numberOfChildren(); } template<> int BinaryOperationNode<20>::numberOfChildren() const { return BitsClearExplicit::s_functionHelper.numberOfChildren(); } template<> int BinaryOperationNode<21>::numberOfChildren() const { return ShiftLogicLeft::s_functionHelper.numberOfChildren(); } - template<> int BinaryOperationNode<22>::numberOfChildren() const { return ShiftLogicLeftExplicit::s_functionHelper.numberOfChildren(); } template<> int BinaryOperationNode<23>::numberOfChildren() const { return ShiftLogicRight::s_functionHelper.numberOfChildren(); } - template<> int BinaryOperationNode<24>::numberOfChildren() const { return ShiftLogicRightExplicit::s_functionHelper.numberOfChildren(); } template<> int BinaryOperationNode<25>::numberOfChildren() const { return ShiftArithmeticRight::s_functionHelper.numberOfChildren(); } template<> int BinaryOperationNode<26>::numberOfChildren() const { return ShiftArithmeticRightExplicit::s_functionHelper.numberOfChildren(); } template<> int BinaryOperationNode<27>::numberOfChildren() const { return RotateLeft::s_functionHelper.numberOfChildren(); } @@ -116,21 +112,11 @@ namespace Poincare { return LayoutHelper::Prefix(this, floatDisplayMode, numberOfSignificantDigits, ShiftLogicLeft::s_functionHelper.name()); } - template<> - Layout BinaryOperationNode<22>::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const { - return LayoutHelper::Prefix(this, floatDisplayMode, numberOfSignificantDigits, ShiftLogicLeftExplicit::s_functionHelper.name()); - } - template<> Layout BinaryOperationNode<23>::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const { return LayoutHelper::Prefix(this, floatDisplayMode, numberOfSignificantDigits, ShiftLogicRight::s_functionHelper.name()); } - template<> - Layout BinaryOperationNode<24>::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const { - return LayoutHelper::Prefix(this, floatDisplayMode, numberOfSignificantDigits, ShiftLogicRightExplicit::s_functionHelper.name()); - } - template<> Layout BinaryOperationNode<25>::createLayout(Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const { return LayoutHelper::Prefix(this, floatDisplayMode, numberOfSignificantDigits, ShiftArithmeticRight::s_functionHelper.name()); @@ -182,9 +168,7 @@ namespace Poincare { T == 27 ? RotateLeft::s_functionHelper.name() : T == 26 ? ShiftArithmeticRightExplicit::s_functionHelper.name() : T == 25 ? ShiftArithmeticRight::s_functionHelper.name() : - T == 24 ? ShiftLogicRightExplicit::s_functionHelper.name() : T == 23 ? ShiftLogicRight::s_functionHelper.name() : - T == 22 ? ShiftLogicLeftExplicit::s_functionHelper.name() : T == 21 ? ShiftLogicLeft::s_functionHelper.name() : T == 20 ? BitsClearExplicit::s_functionHelper.name() : T == 19 ? BitsClear::s_functionHelper.name() : @@ -260,21 +244,11 @@ namespace Poincare { return ShiftLogicLeft(this).shallowReduce(reductionContext); } - template<> - Expression BinaryOperationNode<22>::shallowReduce(ExpressionNode::ReductionContext reductionContext) { - return ShiftLogicLeftExplicit(this).shallowReduce(reductionContext); - } - template<> Expression BinaryOperationNode<23>::shallowReduce(ExpressionNode::ReductionContext reductionContext) { return ShiftLogicRight(this).shallowReduce(reductionContext); } - template<> - Expression BinaryOperationNode<24>::shallowReduce(ExpressionNode::ReductionContext reductionContext) { - return ShiftLogicRightExplicit(this).shallowReduce(reductionContext); - } - template<> Expression BinaryOperationNode<25>::shallowReduce(ExpressionNode::ReductionContext reductionContext) { return ShiftArithmeticRight(this).shallowReduce(reductionContext); @@ -365,8 +339,6 @@ namespace Poincare { switch(t) { case ExpressionNode::Type::BitsClearExplicit: - case ExpressionNode::Type::ShiftLogicLeftExplicit: - case ExpressionNode::Type::ShiftLogicRightExplicit: case ExpressionNode::Type::ShiftArithmeticRightExplicit: case ExpressionNode::Type::RotateLeftExplicit: case ExpressionNode::Type::RotateRightExplicit: @@ -416,15 +388,9 @@ namespace Poincare { case ExpressionNode::Type::ShiftLogicLeft: x = Integer::LogicalShift(aq, bq); break; - case ExpressionNode::Type::ShiftLogicLeftExplicit: - x = Integer::LogicalShift(aq, bq, cq); - break; case ExpressionNode::Type::ShiftLogicRight: x = Integer::LogicalShift(aq, bq_neg); break; - case ExpressionNode::Type::ShiftLogicRightExplicit: - x = Integer::LogicalShift(aq, bq_neg, cq); - break; case ExpressionNode::Type::ShiftArithmeticRight: x = Integer::LogicalShiftRightArithmetic(aq, bq); break; @@ -505,18 +471,10 @@ namespace Poincare { return BinaryOperation::shallowReduceDirect(*this, ExpressionNode::Type::ShiftLogicLeft, reductionContext); } - Expression ShiftLogicLeftExplicit::shallowReduce(ExpressionNode::ReductionContext reductionContext) { - return BinaryOperation::shallowReduceDirect(*this, ExpressionNode::Type::ShiftLogicLeftExplicit, reductionContext); - } - Expression ShiftLogicRight::shallowReduce(ExpressionNode::ReductionContext reductionContext) { return BinaryOperation::shallowReduceDirect(*this, ExpressionNode::Type::ShiftLogicRight, reductionContext); } - Expression ShiftLogicRightExplicit::shallowReduce(ExpressionNode::ReductionContext reductionContext) { - return BinaryOperation::shallowReduceDirect(*this, ExpressionNode::Type::ShiftLogicRightExplicit, reductionContext); - } - Expression ShiftArithmeticRight::shallowReduce(ExpressionNode::ReductionContext reductionContext) { return BinaryOperation::shallowReduceDirect(*this, ExpressionNode::Type::ShiftArithmeticRight, reductionContext); } diff --git a/poincare/src/parsing/parser.h b/poincare/src/parsing/parser.h index e4d50609c..8a457c98a 100644 --- a/poincare/src/parsing/parser.h +++ b/poincare/src/parsing/parser.h @@ -167,11 +167,9 @@ private: &Sine::s_functionHelper, &HyperbolicSine::s_functionHelper, &ShiftLogicLeft::s_functionHelper, - &ShiftLogicLeftExplicit::s_functionHelper, &ShiftArithmeticRight::s_functionHelper, &ShiftArithmeticRightExplicit::s_functionHelper, &ShiftLogicRight::s_functionHelper, - &ShiftLogicRightExplicit::s_functionHelper, &Sum::s_functionHelper, &Tangent::s_functionHelper, &HyperbolicTangent::s_functionHelper, diff --git a/poincare/src/tree_handle.cpp b/poincare/src/tree_handle.cpp index 06bafb197..01e63a2d6 100644 --- a/poincare/src/tree_handle.cpp +++ b/poincare/src/tree_handle.cpp @@ -377,9 +377,7 @@ template Round TreeHandle::FixedArityBuilder(const Tuple &); template ShiftArithmeticRight TreeHandle::FixedArityBuilder >(const Tuple &); template ShiftArithmeticRightExplicit TreeHandle::FixedArityBuilder >(const Tuple &); template ShiftLogicLeft TreeHandle::FixedArityBuilder >(const Tuple &); -template ShiftLogicLeftExplicit TreeHandle::FixedArityBuilder >(const Tuple &); template ShiftLogicRight TreeHandle::FixedArityBuilder >(const Tuple &); -template ShiftLogicRightExplicit TreeHandle::FixedArityBuilder >(const Tuple &); template SignFunction TreeHandle::FixedArityBuilder(const Tuple &); template SimplePredictionInterval TreeHandle::FixedArityBuilder(const Tuple &); template Sine TreeHandle::FixedArityBuilder(const Tuple &); diff --git a/poincare/test/parsing.cpp b/poincare/test/parsing.cpp index 3f447cf03..5cbefc556 100644 --- a/poincare/test/parsing.cpp +++ b/poincare/test/parsing.cpp @@ -441,9 +441,7 @@ QUIZ_CASE(poincare_parsing_identifiers) { assert_parsed_expression_is("sra(1,1)", ShiftArithmeticRight::Builder(BasedInteger::Builder(1), BasedInteger::Builder(1))); assert_parsed_expression_is("sra(1,1,1)", ShiftArithmeticRightExplicit::Builder(BasedInteger::Builder(1), BasedInteger::Builder(1), BasedInteger::Builder(1))); assert_parsed_expression_is("sll(1,1)", ShiftLogicLeft::Builder(BasedInteger::Builder(1), BasedInteger::Builder(1))); - assert_parsed_expression_is("sll(1,1,1)", ShiftLogicLeftExplicit::Builder(BasedInteger::Builder(1), BasedInteger::Builder(1), BasedInteger::Builder(1))); assert_parsed_expression_is("srl(1,1)", ShiftLogicRight::Builder(BasedInteger::Builder(1), BasedInteger::Builder(1))); - assert_parsed_expression_is("srl(1,1,1)", ShiftLogicRightExplicit::Builder(BasedInteger::Builder(1), BasedInteger::Builder(1), BasedInteger::Builder(1))); assert_parsed_expression_is("tc(1,1)", TwosComplement::Builder(BasedInteger::Builder(1), BasedInteger::Builder(1))); }