GDScript: Be more lenient with identifiers

- Allow identifiers similar to keywords if they are in ASCII range.
- Allow constants to be treated as regular identifiers.
- Allow keywords that can be used as identifiers in expressions.
This commit is contained in:
George Marques 2023-02-09 11:17:37 -03:00
parent d02a7bc00d
commit 03ea77407c
No known key found for this signature in database
GPG key ID: 046BD46A3201E43D
8 changed files with 67 additions and 6 deletions

View file

@ -1,5 +1,12 @@
extends Node
func test():
var port = 0 # Only latin characters.
var pοrt = 1 # The "ο" is Greek omicron.
prints(port, pοrt)
# Do not call this since nodes aren't in the tree. It is just a parser check.
func nodes():
var _node1 = $port # Only latin characters.
var _node2 = $pοrt # The "ο" is Greek omicron.