]> gerrit.simantics Code Review - simantics/platform.git/commit
Fixed InvertBasicExpressionVisitor bugs with subtractions and divisions 61/4061/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 30 Mar 2020 22:13:59 +0000 (01:13 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 30 Mar 2020 22:22:23 +0000 (22:22 +0000)
commit56072ec7b520b312937515aa3822f35acf7d3cd9
treea52da872df2c536529e19a78b895b45da53353a5
parentd027c3f5e5fd0a1f6c56b7036d7d0f62e605163c
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
(cherry picked from commit 1819be12c9a971df1dea5daa8190162ac1e20bb6)
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]