]> gerrit.simantics Code Review - simantics/platform.git/commit
Fixed InvertBasicExpressionVisitor bugs with subtractions and divisions
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 30 Mar 2020 22:13:59 +0000 (01:13 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 25 Oct 2021 09:34:41 +0000 (12:34 +0300)
commit425aa6cc015ffdbe519c67b36fe9675c66ebe211
treec3a6792582e62f21f0a5312fa934ff7acc60aa94
parent20e3e7c2e79f47044bd625d757447b16d699a7bc
Fixed InvertBasicExpressionVisitor bugs with subtractions and divisions

Minus expressions and divisions were both computed the wrong way around,
i.e. a-b as b-a and a/b as b/a.

Consolidated duplicate InvertBasicExpressionVisitor code into single
base class.

Also noticed that the basicexpression parser doesn't parse e.g. `a*5/4`
but parses `a*5 / 4` just fine. Didn't dive into these parser problems
for now. Hopefully we can retire this code entirely at some point in
favor of SCL expressions.

gitlab #505

Change-Id: I74eaeae1dbec080a10ffc43c0c321705c0b0ea86
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/expression/InvertBasicExpressionVisitor.java
bundles/org.simantics.modeling/src/org/simantics/modeling/InvertBasicExpressionVisitor.java
bundles/org.simantics.modeling/src/org/simantics/modeling/InvertBasicExpressionVisitorBase.java [new file with mode: 0644]