-
Notifications
You must be signed in to change notification settings - Fork 591
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
Python-style indentation in v6, edge cases not working initial findings - now fixed #763
Comments
If you try to comment off the following lines in tagui_parse.php, script will compile but will throw error as expected because it was not given the context of where the brackets are in output script to form a syntactically correct JS script.
|
In the meantime, I've parked the positive test case below, under this is resolve then I test again - https://github.com/kelaberetiv/TagUI/blob/positive_test/src/test/positive_test.tag |
Below is another example with error, if the 3 lines in tagui_parse.php are commented off. They shouldn't be commented off, the Python style indentation should be inserting brackets before that is triggered. Otherwise syntactically incorrect JS will be created.
|
Hi @siowyisheng raised PR #769 with following comments - Hi @siowyisheng I traced through the code. The solution is a simple fix to simply remove pre v6 functionality of auto-appending brackets for code such as below. Since the assumption is not to have backward compatibility, then the following block of code should have indentation given by user already instead of assuming indenting once on user's behalf.
This fix is tested to be working for -
and
For your review if this change works for the earlier test cases you used for this feature. |
fix indentation edge case in #763
Great, in the meantime, users can get this fix from below zip, to overwrite existing v6 installation - |
Reopening this issue because the fix is done, but not yet in the packaged zips in the latest release. |
Users can download the latest copy of the code from here and unzip to overwrite your existing installation (please drag the folders under tagui\src to overwrite your existing installation) - https://github.com/kelaberetiv/TagUI/archive/master.zip In the next release, this will become part of the packaged zip files. |
Closing issue since the latest packaged release TagUI v6.14 is out. Release notes - https://github.com/kelaberetiv/TagUI/releases/tag/v6.14.0 |
Hi @siowyisheng I finish writing the positive test cases for v6 and added tests for using ocr and exist(). Found following edge case not working. Whenever there is nested loops, nested if etc.
Above code will throw below error -
This is by design because it is syntactically hard or perhaps impossible to automatically infer when users try to do this without using brackets in pre-v6. However, in v6, somehow by the time parsing reaches there, it seems to be not interpreted with the brackets {} inserted, thus triggering the error.
The text was updated successfully, but these errors were encountered: