FIX: Correct order when stringify -(A1^1.22) and (-A1)^1.22 (#484)

Fixes #483
This commit is contained in:
Nicolás Hatcher Andrés
2025-10-27 19:09:31 +01:00
committed by GitHub
parent c88bcb94ae
commit 1edfb2df1c
5 changed files with 44 additions and 3 deletions

View File

@@ -520,6 +520,7 @@ fn stringify(
let x = match **left {
BooleanKind(_)
| NumberKind(_)
| UnaryKind { .. }
| StringKind(_)
| ReferenceKind { .. }
| RangeKind { .. }
@@ -535,7 +536,6 @@ fn stringify(
| FunctionKind { .. }
| InvalidFunctionKind { .. }
| ArrayKind(_)
| UnaryKind { .. }
| ErrorKind(_)
| ParseErrorKind { .. }
| OpSumKind { .. }
@@ -630,7 +630,6 @@ fn stringify(
| OpRangeKind { .. }
| OpConcatenateKind { .. }
| OpProductKind { .. }
| OpPowerKind { .. }
| FunctionKind { .. }
| InvalidFunctionKind { .. }
| ArrayKind(_)
@@ -643,7 +642,7 @@ fn stringify(
| ParseErrorKind { .. }
| EmptyArgKind => false,
OpSumKind { .. } | UnaryKind { .. } => true,
OpPowerKind { .. } | OpSumKind { .. } | UnaryKind { .. } => true,
};
if needs_parentheses {
format!(