godot
godot copied to clipboard
Change is_valid_identifier() in ustring to be similar to is_valid_identifier() in text_server.
Make it possible to use UTF in places like in the image below.
I'm not sure if it is a good idea to change
is_valid_identifier()
. Most likely there are other parts of the GDScript parser that will need to be changed (and if we decide to do it, it should use a proper implementation forTextServer
).
The simple GDScript project here tested fine, but perhaps more complex testing is needed. The ultimate goal is to make GDScript also support UTF variables.(At present, C # is supported) But too many changes at once will lead to complicated problems, so first change this one method, and then give the rest to another PR.
这里简单的GDScript项目测试没有问题,或许还需要更多复杂的测试. 最终目标是希望让GDScript也能支持UTF变量.(目前C#是支持的.) 但是一次性改太多会导致问题复杂,所以先就改这个一个方法,其他的再交给另外的PR.
Many different places use this function and rely on it functioning as it does, there are a lot of places in code where this could cause errors
This would cause a lot of confusion for GDScript users, allowing them to create functions that aren't valid functions, it's also used by for example the global shader parameters, properties, visual shader, etc. etc.
I would instead recommend adding a function to ScriptLanguage
for getting valid identifiers and integrating that into this