From 7548e043fce1211e21030bb41c6fe6d6900a7a5a Mon Sep 17 00:00:00 2001 From: George Marques Date: Wed, 18 Jan 2023 22:56:00 -0300 Subject: 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. --- .../tests/scripts/parser/errors/identifier_similar_to_keyword.gd | 3 +++ .../tests/scripts/parser/errors/identifier_similar_to_keyword.out | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 modules/gdscript/tests/scripts/parser/errors/identifier_similar_to_keyword.gd create mode 100644 modules/gdscript/tests/scripts/parser/errors/identifier_similar_to_keyword.out (limited to 'modules/gdscript/tests/scripts/parser/errors') diff --git a/modules/gdscript/tests/scripts/parser/errors/identifier_similar_to_keyword.gd b/modules/gdscript/tests/scripts/parser/errors/identifier_similar_to_keyword.gd new file mode 100644 index 0000000000..4b1f284070 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/identifier_similar_to_keyword.gd @@ -0,0 +1,3 @@ +func test(): + var аs # Using Cyrillic "а". + print(аs) diff --git a/modules/gdscript/tests/scripts/parser/errors/identifier_similar_to_keyword.out b/modules/gdscript/tests/scripts/parser/errors/identifier_similar_to_keyword.out new file mode 100644 index 0000000000..337dec2f4d --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/identifier_similar_to_keyword.out @@ -0,0 +1,2 @@ +GDTEST_PARSER_ERROR +Identifier "аs" is visually similar to the GDScript keyword "as" and thus not allowed. -- cgit v1.2.3