Initial commit

This commit is contained in:
hertog 2025-03-13 08:40:48 +00:00
commit 65227bf3a5
12416 changed files with 6001067 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 @@
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 ":" after function declaration.

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 @@
@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,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.

View file

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1,3 @@
func test():
print("Using spaces")
print("Using tabs")

View file

@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Used tab character for indentation instead of space as used before in the file.

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