From f95967c29993f4008a40ae1871a62f91bf301c47 Mon Sep 17 00:00:00 2001 From: George Marques Date: Thu, 9 Feb 2023 10:16:00 -0300 Subject: GDScript: Allow strings as multiline comments Bring back the behavior in 3.x that was left out by oversight. --- .../parser/features/allow_strings_as_comments.gd | 21 +++++++++++++++++++++ .../parser/features/allow_strings_as_comments.out | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 modules/gdscript/tests/scripts/parser/features/allow_strings_as_comments.gd create mode 100644 modules/gdscript/tests/scripts/parser/features/allow_strings_as_comments.out (limited to 'modules/gdscript/tests/scripts/parser/features') diff --git a/modules/gdscript/tests/scripts/parser/features/allow_strings_as_comments.gd b/modules/gdscript/tests/scripts/parser/features/allow_strings_as_comments.gd new file mode 100644 index 0000000000..3ecd65ad9c --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/features/allow_strings_as_comments.gd @@ -0,0 +1,21 @@ +""" +This is a comment. +""" + +@tool + +""" +This is also a comment. +""" + +extends RefCounted + +''' +This is a comment too. +''' + +func test(): + """ + This too is a comment. + """ + print("ok") diff --git a/modules/gdscript/tests/scripts/parser/features/allow_strings_as_comments.out b/modules/gdscript/tests/scripts/parser/features/allow_strings_as_comments.out new file mode 100644 index 0000000000..1b47ed10dc --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/features/allow_strings_as_comments.out @@ -0,0 +1,2 @@ +GDTEST_OK +ok -- cgit v1.2.3