mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[poincare] Fix multiplication symbol before Symbol Expression
This makes consistent 2x and 2θ (sign omission in both cases).
This commit is contained in:
committed by
LeaNumworks
parent
a3da08323b
commit
90b3e52c0c
@@ -34,7 +34,7 @@ public:
|
||||
/* Simplification */
|
||||
Expression shallowReduce(ReductionContext reductionContext) override;
|
||||
Expression shallowReplaceReplaceableSymbols(Context * context) override;
|
||||
LayoutShape leftLayoutShape() const override { return strlen(m_name) > 1 ? LayoutShape::MoreLetters : LayoutShape::OneLetter; };
|
||||
LayoutShape leftLayoutShape() const override;
|
||||
|
||||
/* Approximation */
|
||||
Evaluation<float> approximate(SinglePrecision p, Context * context, Preferences::ComplexFormat complexFormat, Preferences::AngleUnit angleUnit) const override { return templatedApproximate<float>(context, complexFormat, angleUnit); }
|
||||
|
||||
@@ -107,6 +107,15 @@ Expression SymbolNode::shallowReplaceReplaceableSymbols(Context * context) {
|
||||
return Symbol(this).shallowReplaceReplaceableSymbols(context);
|
||||
}
|
||||
|
||||
ExpressionNode::LayoutShape SymbolNode::leftLayoutShape() const {
|
||||
UTF8Decoder decoder(m_name);
|
||||
decoder.nextCodePoint();
|
||||
if (decoder.nextCodePoint() == UCodePointNull) { // nextCodePoint asserts that the first character is non-null
|
||||
return LayoutShape::OneLetter;
|
||||
}
|
||||
return LayoutShape::MoreLetters;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
Evaluation<T> SymbolNode::templatedApproximate(Context * context, Preferences::ComplexFormat complexFormat, Preferences::AngleUnit angleUnit) const {
|
||||
Symbol s(this);
|
||||
|
||||
Reference in New Issue
Block a user