You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue description:
At the moment, gdscript does not allow assignment in conditionals, such as "if a = b:", yielding an "Unexpected assign" error.
While I understand the wisdom of this, I can also see some scenarios where allowing these would make code more readable and maintainable, which is no less important. Here is one example, for parsing a string that may have a host of different formats:
if regexmatch = regex1.search(string):
[extract some data from groups collected in regexmatch]
elif regexmatch = regex2.search(string):
[extract some data from groups collected in regexmatch]
elif regexmatch = regex3.search(string):
[extract some data from groups collected in regexmatch]
elif regexmatch = regex4.search(string):
[extract some data from groups collected in regexmatch]
So, any chance of changing assignment in conditional from error to warning?
The text was updated successfully, but these errors were encountered:
Godot version:
Godot_v3.1.1-stable_win64
Issue description:
At the moment, gdscript does not allow assignment in conditionals, such as "if a = b:", yielding an "Unexpected assign" error.
While I understand the wisdom of this, I can also see some scenarios where allowing these would make code more readable and maintainable, which is no less important. Here is one example, for parsing a string that may have a host of different formats:
So, any chance of changing assignment in conditional from error to warning?
The text was updated successfully, but these errors were encountered: