feat: godot-engine-source-4.3-stable

This commit is contained in:
Jan van der Weide 2025-01-17 16:36:38 +01:00
parent c59a7dcade
commit 7125d019b5
11149 changed files with 5070401 additions and 0 deletions

View file

@ -0,0 +1,2 @@
[*.{gd,out}]
trim_trailing_whitespace = false

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

View file

@ -0,0 +1,3 @@
func test():
# Number separators may not be placed right next to each other.
var _num = 1__23

View file

@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Multiple underscores cannot be adjacent in a numeric literal.

View file

@ -0,0 +1,3 @@
func test():
# Number separators may not be placed right next to each other.
var _num = 123.45__67

View file

@ -0,0 +1,2 @@
GDTEST_PARSER_ERROR
Multiple underscores cannot be adjacent in a numeric literal.

View file

@ -0,0 +1,5 @@
extends Node
func test():
var a = $ # Expected some node path.

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 while = "it's been a while"

View file

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

View file

@ -0,0 +1,5 @@
func test():
const TEST = 25
# Error here (can't redeclare a constant on the same scope).
const TEST = 50

View file

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

View file

@ -0,0 +1,5 @@
func _static_init():
print("static init")
func test():
print("done")

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