The preview should explain how the expression is being parsed.
With the introduction of #53 (closed) and similar features, there has been quite some ambiguity introduced into how an expression could be interpreted (f.e. #65 (closed)). Not only should these be sorted out, but there should be a way for the user to see how the expression is being interpreted. Ideally the live preview can be used for that for the GUI. But most likely there should be an "explain" command which displays additional information about the expression, including the units it gets converted from and to and how certain things are being replaced.
For that to work, the Evaluator
and EvaluatedExpression
needs to change quite a lot, as it needs to return and contain all this information. Something like this:
EvaluatedExpression
- ID
- Result
- "From" unit
- "To" unit
- Expression as provided
- Expression as evaluated
- Result before unit conversion
That can then be provided to the user.