initial commit, 4.5 stable
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled

This commit is contained in:
2025-09-16 20:46:46 -04:00
commit 9d30169a8d
13378 changed files with 7050105 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
# This annotation should be used within a documentation comment instead:
# ## @deprecated: Reason here.
@deprecated
var some_variable = "value"

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
"@deprecated" annotation does not exist. Use "## @deprecated: Reason here." instead.

View File

@@ -0,0 +1,6 @@
# This annotation should be used within a documentation comment instead:
# ## @experimental: Reason here.
@experimental("This function isn't implemented yet.")
func say_hello():
pass

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
"@experimental" annotation does not exist. Use "## @experimental: Reason here." instead.

View File

@@ -0,0 +1,4 @@
@export_enum("A",, "B", "C") var a
func test():
pass

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected expression as the annotation argument.

View File

@@ -0,0 +1,3 @@
@export
func test():
pass

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Annotation "@export" cannot be applied to a function.

View File

@@ -0,0 +1,5 @@
# This annotation should be used within a documentation comment instead:
# ## @tutorial(Title): https://example.com
@tutorial("https://example.com")
const SOME_CONSTANT = "value"

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
"@tutorial" annotation does not exist. Use "## @tutorial(Title): https://example.com" instead.

View File

@@ -0,0 +1,3 @@
@hello_world
func test():
pass

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Unrecognized annotation: "@hello_world".

View File

@@ -0,0 +1,3 @@
func test():
# Arrays with consecutive commas are not allowed.
var array = ["arrays",,,,]

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected expression as array element.

View File

@@ -0,0 +1,2 @@
func test():
var hello == "world"

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected end of statement after variable declaration, found "==" instead.

View File

@@ -0,0 +1,2 @@
func test():
var hello === "world"

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected end of statement after variable declaration, found "==" instead.

View File

@@ -0,0 +1,3 @@
func test():
var a = 0
a =

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected an expression after "=".

View File

@@ -0,0 +1,4 @@
func test():
# Error here.
if foo = 25:
print(foo)

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Assignment is not allowed inside an expression.

View File

@@ -0,0 +1,2 @@
func test():
var hello = "world" = "test"

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Assignment is not allowed inside an expression.

View File

@@ -0,0 +1,4 @@
func test():
# Error here.
if var foo = 25:
print(foo)

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected conditional expression after "if".

View File

@@ -0,0 +1,2 @@
func test():
var = "world"

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected variable name after "var".

View File

@@ -0,0 +1,5 @@
func test():
for index in range(0, 1):
var lambda := func():
continue
print('not ok')

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Cannot use "continue" outside of a loop.

View File

@@ -0,0 +1,2 @@
func test():
print(r"\")

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Unterminated string.

View File

@@ -0,0 +1,2 @@
func test():
print(r"\\"")

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Unterminated string.

View File

@@ -0,0 +1,3 @@
func test():
# v
print(r"['"]*")

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Closing "]" doesn't have an opening counterpart.

View File

@@ -0,0 +1,2 @@
func test():
print(~)

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected expression after "~" operator.

View File

@@ -0,0 +1,2 @@
func test():
print(not)

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected expression after "not" operator.

View File

@@ -0,0 +1,2 @@
func test():
print(!)

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected expression after "!" operator.

View File

@@ -0,0 +1,3 @@
func test() {
print("Hello world!");
}

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected end of statement after bodyless function declaration, found "{" instead.

View File

@@ -0,0 +1,6 @@
# Error here. Annotations should be used before `class_name`, not after.
class_name WrongAnnotationPlace
@icon("res://path/to/optional/icon.svg")
func test():
pass

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Annotation "@icon" must be at the top of the script, before "extends" and "class_name".

View File

@@ -0,0 +1,3 @@
func test():
var TEST = 50
const TEST = 25

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
There is already a variable named "TEST" declared in this scope.

View File

@@ -0,0 +1,7 @@
func hello(arg1):
print(arg1)
func test():
# Error here.
hello(arg1 = 25)

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Assignment is not allowed inside an expression.

View File

@@ -0,0 +1,2 @@
func test():
$=$

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected node path as string or identifier after "$".

View File

@@ -0,0 +1,2 @@
func test():
var dictionary = { hello = "world",, }

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected expression as dictionary key.

View File

@@ -0,0 +1,5 @@
@icon("res://1.png")
@icon("res://1.png")
func test():
pass

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
"@icon" annotation can only be used once.

View File

@@ -0,0 +1,5 @@
@tool
@tool
func test():
pass

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
"@tool" annotation can only be used once.

View File

@@ -0,0 +1,4 @@
@export_enum("A", "B", "C") var x: Array[Color]
func test():
pass

View File

@@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
>> ERROR at line 1: "@export_enum" annotation requires a variable of type "int", "Array[int]", "PackedByteArray", "PackedInt32Array", "PackedInt64Array", "String", "Array[String]", or "PackedStringArray", but type "Array[Color]" was given instead.

View File

@@ -0,0 +1,4 @@
@export_enum("A", "B", "C") var x: Color
func test():
pass

View File

@@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
>> ERROR at line 1: "@export_enum" annotation requires a variable of type "int", "Array[int]", "PackedByteArray", "PackedInt32Array", "PackedInt64Array", "String", "Array[String]", or "PackedStringArray", but type "Color" was given instead.

View File

@@ -0,0 +1,5 @@
export var test = 3
func test():
pass

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
The "export" keyword was removed in Godot 4. Use an export annotation ("@export", "@export_range", etc.) instead.

View File

@@ -0,0 +1,5 @@
export(int, "a", "b", "c") var test = 3
func test():
pass

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
The "export" keyword was removed in Godot 4. Use an export annotation ("@export", "@export_range", etc.) instead.

View File

@@ -0,0 +1 @@
@export_tool_button("Click me!") var action

View File

@@ -0,0 +1,2 @@
GDTEST_ANALYZER_ERROR
>> ERROR at line 1: Tool buttons can only be used in tool scripts (add "@tool" to the top of the script).

View File

@@ -0,0 +1,5 @@
const test = 25
func test():
pass

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Function "test" has the same name as a previously declared constant.

View File

@@ -0,0 +1,7 @@
func test():
pass
# Error here. The difference with `variable-conflicts-function.gd` is that here,
# the function is defined *before* the variable.
var test = 25

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Variable "test" has the same name as a previously declared function.

View File

@@ -0,0 +1,3 @@
func test():
var аs # Using Cyrillic "а".
print(аs)

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Identifier "аs" is visually similar to the GDScript keyword "as" and thus not allowed.

View File

@@ -0,0 +1,2 @@
func test():
var escape = "invalid escape \h <- here"

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Invalid escape in string.

View File

@@ -0,0 +1,3 @@
func test():
# Error here.
var 23test = "is not a valid identifier"

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected variable name after "var".

View File

@@ -0,0 +1,3 @@
func test():
# Error here.
var "yes" = "is not a valid identifier"

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected variable name after "var".

View File

@@ -0,0 +1,5 @@
func test():
var amount = 50
# C-style ternary operator is invalid in GDScript.
# The valid syntax is `"yes" if amount < 60 else "no"`, like in Python.
var ternary = amount < 60 ? "yes" : "no"

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Unexpected "?" in source. If you want a ternary operator, use "truthy_value if true_condition else falsy_value".

View File

@@ -0,0 +1,6 @@
# https://github.com/godotengine/godot/issues/73273
func not_called():
var v
v=func(): v=1
in v

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected statement, found "in" instead.

View File

@@ -0,0 +1,3 @@
func test():
func standalone():
print("can't be accessed")

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Standalone lambdas cannot be accessed. Consider assigning it to a variable.

View File

@@ -0,0 +1,3 @@
# No colon --v
var f = func () -> void
pass

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected ":" after lambda declaration.

View File

@@ -0,0 +1,5 @@
func test():
var a = 0
match a:
0 when a = 1:
print("assignment not allowed on pattern guard")

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Assignment is not allowed inside an expression.

View File

@@ -0,0 +1,4 @@
func test():
match 1:
[[[var a]]], 2:
pass

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Cannot use a variable bind with multiple patterns.

View File

@@ -0,0 +1,2 @@
func test():
var a = ("missing paren ->"

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected closing ")" after grouping expression.

View File

@@ -0,0 +1,3 @@
func test():
if true # Missing colon here.
print("true")

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected ":" after "if" condition.

View File

@@ -0,0 +1,4 @@
func test():
var x = 1 if false else
print("oops")
print(x)

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected expression after "else".

View File

@@ -0,0 +1,6 @@
func args(a, b):
print(a)
print(b)
func test():
args(1,2

View File

@@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Expected closing ")" after call arguments.

Some files were not shown because too many files have changed in this diff Show More