From 291d3aaabefa86b4e102fa7385bcf7aacd240d72 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 25 Jul 2022 00:15:20 +0200 Subject: Improve null and object printing to avoid confusion with arrays - Use different syntax for object printing to avoid confusion with arrays. - Print null as `` to avoid confusion with a string `"null"`. - Display `` in editor resource pickers to avoid confusion with array-based properties. --- modules/gdscript/tests/scripts/analyzer/features/property_inline.out | 2 +- .../gdscript/tests/scripts/parser/features/function_many_parameters.out | 2 +- modules/gdscript/tests/scripts/parser/features/str_preserves_case.out | 2 +- modules/mono/glue/runtime_interop.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/gdscript/tests/scripts/analyzer/features/property_inline.out b/modules/gdscript/tests/scripts/analyzer/features/property_inline.out index 5482592e90..63e59398ae 100644 --- a/modules/gdscript/tests/scripts/analyzer/features/property_inline.out +++ b/modules/gdscript/tests/scripts/analyzer/features/property_inline.out @@ -1,5 +1,5 @@ GDTEST_OK -null + 0 1 2 diff --git a/modules/gdscript/tests/scripts/parser/features/function_many_parameters.out b/modules/gdscript/tests/scripts/parser/features/function_many_parameters.out index 3a979227d4..80df7a3d4c 100644 --- a/modules/gdscript/tests/scripts/parser/features/function_many_parameters.out +++ b/modules/gdscript/tests/scripts/parser/features/function_many_parameters.out @@ -1,2 +1,2 @@ GDTEST_OK -123456789101112131415161718192212223242526272829303132333435363738394041424344454647falsetruenull +123456789101112131415161718192212223242526272829303132333435363738394041424344454647falsetrue diff --git a/modules/gdscript/tests/scripts/parser/features/str_preserves_case.out b/modules/gdscript/tests/scripts/parser/features/str_preserves_case.out index abba38e87c..867f45f0ac 100644 --- a/modules/gdscript/tests/scripts/parser/features/str_preserves_case.out +++ b/modules/gdscript/tests/scripts/parser/features/str_preserves_case.out @@ -1,4 +1,4 @@ GDTEST_OK -null + true false diff --git a/modules/mono/glue/runtime_interop.cpp b/modules/mono/glue/runtime_interop.cpp index 529bda4c38..49a8109ab4 100644 --- a/modules/mono/glue/runtime_interop.cpp +++ b/modules/mono/glue/runtime_interop.cpp @@ -1319,7 +1319,7 @@ void godotsharp_object_to_string(Object *p_ptr, godot_string *r_str) { #endif // Can't call 'Object::to_string()' here, as that can end up calling 'ToString' again resulting in an endless circular loop. memnew_placement(r_str, - String("[" + p_ptr->get_class() + ":" + itos(p_ptr->get_instance_id()) + "]")); + String("<" + p_ptr->get_class() + "#" + itos(p_ptr->get_instance_id()) + ">")); } #ifdef __cplusplus -- cgit v1.2.3