feat: godot-engine-source-4.3-stable
This commit is contained in:
parent
c59a7dcade
commit
7125d019b5
11149 changed files with 5070401 additions and 0 deletions
|
|
@ -0,0 +1,2 @@
|
|||
[*.{gd,out}]
|
||||
trim_trailing_whitespace = false
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
@export_enum("A",, "B", "C") var a
|
||||
|
||||
func test():
|
||||
pass
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected expression as the annotation argument.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func test():
|
||||
# Arrays with consecutive commas are not allowed.
|
||||
var array = ["arrays",,,,]
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected expression as array element.
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
func test():
|
||||
var hello == "world"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected end of statement after variable declaration, found "==" instead.
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
func test():
|
||||
var hello === "world"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected end of statement after variable declaration, found "==" instead.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func test():
|
||||
var a = 0
|
||||
a =
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected an expression after "=".
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
# Error here.
|
||||
if foo = 25:
|
||||
print(foo)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Assignment is not allowed inside an expression.
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
func test():
|
||||
var hello = "world" = "test"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Assignment is not allowed inside an expression.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
# Error here.
|
||||
if var foo = 25:
|
||||
print(foo)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected conditional expression after "if".
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
func test():
|
||||
var = "world"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected variable name after "var".
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
func test():
|
||||
for index in range(0, 1):
|
||||
var lambda := func():
|
||||
continue
|
||||
print('not ok')
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Cannot use "continue" outside of a loop.
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
func test():
|
||||
print(r"\")
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Unterminated string.
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
func test():
|
||||
print(r"\\"")
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Unterminated string.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func test():
|
||||
# v
|
||||
print(r"['"]*")
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Closing "]" doesn't have an opening counterpart.
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
func test():
|
||||
print(~)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected expression after "~" operator.
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
func test():
|
||||
print(not)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected expression after "not" operator.
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
func test():
|
||||
print(!)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected expression after "!" operator.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func test() {
|
||||
print("Hello world!");
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected ":" after function declaration.
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Annotation "@icon" must be at the top of the script, before "extends" and "class_name".
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func test():
|
||||
var TEST = 50
|
||||
const TEST = 25
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
There is already a variable named "TEST" declared in this scope.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
func hello(arg1):
|
||||
print(arg1)
|
||||
|
||||
|
||||
func test():
|
||||
# Error here.
|
||||
hello(arg1 = 25)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Assignment is not allowed inside an expression.
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
func test():
|
||||
$=$
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected node path as string or identifier after "$".
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
func test():
|
||||
var dictionary = { hello = "world",, }
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected expression as dictionary key.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
@icon("res://1.png")
|
||||
@icon("res://1.png")
|
||||
|
||||
func test():
|
||||
pass
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
"@icon" annotation can only be used once.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
@tool
|
||||
@tool
|
||||
|
||||
func test():
|
||||
pass
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
"@tool" annotation can only be used once.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
@export_enum("A", "B", "C") var x: Array[Color]
|
||||
|
||||
func test():
|
||||
pass
|
||||
|
|
@ -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.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
@export_enum("A", "B", "C") var x: Color
|
||||
|
||||
func test():
|
||||
pass
|
||||
|
|
@ -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.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
const test = 25
|
||||
|
||||
|
||||
func test():
|
||||
pass
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Function "test" has the same name as a previously declared constant.
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Variable "test" has the same name as a previously declared function.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func test():
|
||||
var аs # Using Cyrillic "а".
|
||||
print(аs)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Identifier "аs" is visually similar to the GDScript keyword "as" and thus not allowed.
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
func test():
|
||||
var escape = "invalid escape \h <- here"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Invalid escape in string.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func test():
|
||||
# Error here.
|
||||
var 23test = "is not a valid identifier"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected variable name after "var".
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func test():
|
||||
# Error here.
|
||||
var "yes" = "is not a valid identifier"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected variable name after "var".
|
||||
|
|
@ -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"
|
||||
|
|
@ -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".
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# https://github.com/godotengine/godot/issues/73273
|
||||
|
||||
func not_called():
|
||||
var v
|
||||
v=func(): v=1
|
||||
in v
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected statement, found "in" instead.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func test():
|
||||
func standalone():
|
||||
print("can't be accessed")
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Standalone lambdas cannot be accessed. Consider assigning it to a variable.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
func test():
|
||||
var a = 0
|
||||
match a:
|
||||
0 when a = 1:
|
||||
print("assignment not allowed on pattern guard")
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Assignment is not allowed inside an expression.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
match 1:
|
||||
[[[var a]]], 2:
|
||||
pass
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Cannot use a variable bind with multiple patterns.
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
func test():
|
||||
var a = ("missing paren ->"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected closing ")" after grouping expression.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func test():
|
||||
if true # Missing colon here.
|
||||
print("true")
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected ":" after "if" condition.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
func test():
|
||||
var x = 1 if false else
|
||||
print("oops")
|
||||
print(x)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected expression after "else".
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
func args(a, b):
|
||||
print(a)
|
||||
print(b)
|
||||
|
||||
func test():
|
||||
args(1,2
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected closing ")" after call arguments.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func test():
|
||||
var a = 0
|
||||
print(a--)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected expression after "-" operator.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func test():
|
||||
var a = 0
|
||||
print(a++)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected expression after "+" operator.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func test():
|
||||
print("Using spaces")
|
||||
print("Using tabs")
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Used tab character for indentation instead of space as used before in the file.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func test():
|
||||
# Number separators may not be placed right next to each other.
|
||||
var _num = 1__23
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Multiple underscores cannot be adjacent in a numeric literal.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
func test():
|
||||
# Number separators may not be placed right next to each other.
|
||||
var _num = 123.45__67
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Multiple underscores cannot be adjacent in a numeric literal.
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
extends Node
|
||||
|
||||
|
||||
func test():
|
||||
var a = $ # Expected some node path.
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected node path as string or identifier after "$".
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
func test():
|
||||
var while = "it's been a while"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Expected variable name after "var".
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
func test():
|
||||
const TEST = 25
|
||||
|
||||
# Error here (can't redeclare a constant on the same scope).
|
||||
const TEST = 50
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
There is already a constant named "TEST" declared in this scope.
|
||||
|
|
@ -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
Loading…
Add table
Add a link
Reference in a new issue