summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests/scripts/parser/warnings
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2023-01-18 22:56:00 -0300
committerGeorge Marques <george@gmarqu.es>2023-01-21 13:39:40 -0300
commit7548e043fce1211e21030bb41c6fe6d6900a7a5a (patch)
tree4c9284d244a5586dd490dc9bb40b8017b289b584 /modules/gdscript/tests/scripts/parser/warnings
parent2ec0da1a75a066fe88986fc6ceda22fbabf7eedd (diff)
Add support for Unicode identifiers in GDScript
This is using an adapted version of UAX#31 to not rely on the ICU database (which isn't available in builds without TextServerAdvanced). It allows most characters used in diverse scripts but not everything.
Diffstat (limited to 'modules/gdscript/tests/scripts/parser/warnings')
-rw-r--r--modules/gdscript/tests/scripts/parser/warnings/confusable_identifier.gd5
-rw-r--r--modules/gdscript/tests/scripts/parser/warnings/confusable_identifier.out6
2 files changed, 11 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/parser/warnings/confusable_identifier.gd b/modules/gdscript/tests/scripts/parser/warnings/confusable_identifier.gd
new file mode 100644
index 0000000000..e2caac8ffd
--- /dev/null
+++ b/modules/gdscript/tests/scripts/parser/warnings/confusable_identifier.gd
@@ -0,0 +1,5 @@
+func test():
+ var port = 0 # Only latin characters.
+ var pοrt = 1 # The "ο" is Greek omicron.
+
+ prints(port, pοrt)
diff --git a/modules/gdscript/tests/scripts/parser/warnings/confusable_identifier.out b/modules/gdscript/tests/scripts/parser/warnings/confusable_identifier.out
new file mode 100644
index 0000000000..c483396443
--- /dev/null
+++ b/modules/gdscript/tests/scripts/parser/warnings/confusable_identifier.out
@@ -0,0 +1,6 @@
+GDTEST_OK
+>> WARNING
+>> Line: 3
+>> CONFUSABLE_IDENTIFIER
+>> The identifier "pοrt" has misleading characters and might be confused with something else.
+0 1