-
Notifications
You must be signed in to change notification settings - Fork 3
Fix the resolution of names when variable and jump label names coincide #8
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
Comments
I've been trying to wrap my mind around this whole thing. Maybe it's simpler to think of it - when resolving a symbol, how to look for its corresponding declaration. LValue - needs to find variable/parameterStart at the parent and keep going upwards, keeping track of the previous element (i.e., initially the LValue, and later - the last parent element we've come out of while traversing). If there's element with the required name:
Jump statement value - needs to find
|
I really wonder why LSL allows such code... And how it can work at allO.o Will try to figure out how to make this code be valid in the plugin too! |
I guess I fixed the first case. What about SVC-6712 - I have to write inspection for such cases. |
I never use
jump
and I never assign the same name to multiple things, so this is the most cornery of all corner cases.What makes this even more undesirable to fix is that jumps are weird. This LSL script should explain how labels behave:
...and not to mention labels with the same name being redeclared in inner scopes. ("If multiple jump sites are declared for the same target label within scope, then only the first (top to bottom, left to right) will function as expected, all others will silently fail." - https://wiki.secondlife.com/wiki/Jump). For the sake of simplicity, I'm not including this aspect of labels in this issue.
By the way, calling
mew(0)
prints:The text was updated successfully, but these errors were encountered: