extern "C" { #include #include } #include #include "layout/parenthesis_layout.h" namespace Poincare { Expression::Type Parenthesis::type() const { return Type::Parenthesis; } Expression * Parenthesis::clone() const { Parenthesis * o = new Parenthesis(m_operands, true); return o; } ExpressionLayout * Parenthesis::privateCreateLayout(FloatDisplayMode floatDisplayMode, ComplexFormat complexFormat) const { assert(floatDisplayMode != FloatDisplayMode::Default); assert(complexFormat != ComplexFormat::Default); return new ParenthesisLayout(operand(0)->createLayout(floatDisplayMode, complexFormat)); } Expression * Parenthesis::shallowReduce(Context& context, AngleUnit angleUnit) { Expression * e = Expression::shallowReduce(context, angleUnit); if (e != this) { return e; } return replaceWith(editableOperand(0), true); } template Expression * Parenthesis::templatedApproximate(Context& context, AngleUnit angleUnit) const { return operand(0)->approximate(context, angleUnit); } }