Closed Banaanae closed 3 months ago
Fyi... I am working on IF block masking at the moment as part of Label conversion project. Will also be including other masking such as while, loop, for, switch, try, etc. It supports brace blocks as well as single-line and chained blocks. Also supports multi-line conditions for each of the command types. It should not affect this issue but wanted to let you know about the upcoming masking support in case it comes in handy for this or related/future needs.
Also, I am wondering how you feel about offering support to wrap all IFs (and other single-line-command-blocks) in braces as an option maybe? It should be easy once the masking code is written. What are your thoughts?
Also, I am wondering how you feel about offering support to wrap all IFs (and other single-line-command-blocks) in braces as an option maybe? It should be easy once the masking code is written. What are your thoughts?
If it can be done in a way where future issues are minimal, I think it would be good to implement this
If it can be done in a way where future issues are minimal...
Can you elaborate? What do you envision as an example of "future issues".
What do you envision as an example of "future issues".
I should've explained better I'm thinking nested if's, mix of blocks etc
This is done now, is it ok to merge or will it affect your future PR?
I should've explained better I'm thinking nested if's, mix of blocks etc
The masking currently supports all of this. The following block structures are complete as of now:
Funcs Class Multi-line strings If/ElseIf/Else While and all combinations and nesting between them whether full brace blocks or single line execution.
Will be completed shortly
Switch For Loop Try
(Might be others?)
It's really just a matter of tweaking the current needles slightly since they are all similar structures. And then testing the masking of the many different combinations of interactions between the block structures (I'm doing this as I go).
Once the rest of the needles are complete, I will probably update the current classes in Maskcode.ahk to accommodate the added support.
I'd also like to update the needles in the other files so that there is more consistency and easier to read. Have common global needles that can be called/used by descriptive name instead of the cryptic strings that are scattered throughout the code now. This will also allow the needles to be tweaked in a central location. (MaskCode.ahk, or a new file dedicated to regex needles?). How do you feel about that idea?
This is done now, is it ok to merge or will it affect your future PR?
Should not affect my current project, since I'm working within MaskCode.ahk (for now).
Once all this masking is completed, it will be used to tweak the label-to-func support so that opening/closing braces are placed correctly. All this masking is being created for that goal. But will be available for other uses as needed going forward.
Andy
fix #87 Wraps if in {} if try is present Still needs testing