New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Replacing MOVE statement does not work as separate rule? #120
Comments
Hi m-badura, thanks again for opening this issue! This should now be fixed with version 1.6.0, which was just released. Kind regards, |
Hi Jörg-Michael, Here are examples:
|
Hi m-badura, thanks for stress-testing this rule :-) Modifying your examples a bit, so it's easier to see what happens (and fixing two issues in the third and penultimate line): MOVE 1: TO integer.
MOVE 2 TO integer:.
MOVE 3: TO integer_1, TO integer_2.
MOVE 4 TO integer:,.
MOVE EXACT: 5 to integer.
MOVE EXACT 6: TO integer.
MOVE EXACT 7 TO integer:.
MOVE EXACT: 8 TO integer_1, 9 TO integer_2.
MOVE EXACT 10: TO integer_1, TO integer_2.
MOVE EXACT 11 TO integer:,.
MOVE object_a: ?TO object_1.
MOVE object_b ?TO object_1:.
MOVE object_c: ?TO object_1, ?TO object_2.
MOVE object_d ?TO object_1:,. At least when activating "Unchain into multiple statements" and "Simplify a chain with one element", the result looks good to me: But you're right, the new option within "Replace obsolete MOVE ... TO with =" doesn't get any of those. Will look into it! Or maybe the solution should rather be to offer an additional option within "Unchain into multiple statements" with which obsolete commands like ADD, MOVE, TRANSLATE can be unchained, even if you don't want to unchain everything else? Then the dedicated "Replace obsolete …" rules wouldn't need to care about chains anymore. Kind regards, |
You're welcome! :)
I will not work nights, I will not work nights, ... ;)
Yes, of course! But then it should be documented by the Replace obsolete... rule.
You've got me for it! |
Hi m-badura, with version 1.9.0, which was just released, all your examples should now correctly be replaced! Pondering this for a while, I did however find that "decentral" options are better. Therefore, in 8 rules in the "COMMANDS" group (marked in yellow here) … … you will now find new options like: These options will, in a pre-processing step, first unchain all these obsolete statements (or remove the colon from a "chain of one"), so the replacement then works on all of them. That means, however, that unchaining will include cases in which some (or even all) statements can not be replaced: But I think replacing old or even obsolete syntax in as many cases of as possible is a higher gain than keeping such chains. Thanks again for opening this issue and testing this rule so thoroughly! Kind regards, |
The rule Replace obsolete MOVE ... TO ... with = (1) seems to not cover all cases, when used separately from Unchain into multiple statements (2) and Simplify a chain with one element (3).
Rule (1) will clean this code:
MOVE: 1 to integer_1, 2 TO integer_2.
This code will be cleaned only when rule (2) was selected too:
MOVE: 1 to integer_3.
This code will be cleaned only when rule (3) was selected too:
MOVE 1 TO: integer_4, integer_5.
Since this behavior seems very unintuitive, maybe it could be changed? And if not, at least documented by rule (1)?
The text was updated successfully, but these errors were encountered: