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
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:
@@ -0,0 +1,5 @@
|
||||
# This annotation should be used within a documentation comment instead:
|
||||
# ## @deprecated: Reason here.
|
||||
|
||||
@deprecated
|
||||
var some_variable = "value"
|
@@ -0,0 +1,2 @@
|
||||
GDTEST_PARSER_ERROR
|
||||
"@deprecated" annotation does not exist. Use "## @deprecated: Reason here." instead.
|
@@ -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
|
@@ -0,0 +1,2 @@
|
||||
GDTEST_PARSER_ERROR
|
||||
"@experimental" annotation does not exist. Use "## @experimental: Reason here." instead.
|
@@ -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 @@
|
||||
@export
|
||||
func test():
|
||||
pass
|
@@ -0,0 +1,2 @@
|
||||
GDTEST_PARSER_ERROR
|
||||
Annotation "@export" cannot be applied to a function.
|
@@ -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"
|
@@ -0,0 +1,2 @@
|
||||
GDTEST_PARSER_ERROR
|
||||
"@tutorial" annotation does not exist. Use "## @tutorial(Title): https://example.com" instead.
|
@@ -0,0 +1,3 @@
|
||||
@hello_world
|
||||
func test():
|
||||
pass
|
@@ -0,0 +1,2 @@
|
||||
GDTEST_PARSER_ERROR
|
||||
Unrecognized annotation: "@hello_world".
|
@@ -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 end of statement after bodyless function declaration, found "{" instead.
|
@@ -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
|
||||
>> 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.
|
@@ -0,0 +1,4 @@
|
||||
@export_enum("A", "B", "C") var x: Color
|
||||
|
||||
func test():
|
||||
pass
|
@@ -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.
|
@@ -0,0 +1,5 @@
|
||||
export var test = 3
|
||||
|
||||
|
||||
func test():
|
||||
pass
|
@@ -0,0 +1,2 @@
|
||||
GDTEST_PARSER_ERROR
|
||||
The "export" keyword was removed in Godot 4. Use an export annotation ("@export", "@export_range", etc.) instead.
|
@@ -0,0 +1,5 @@
|
||||
export(int, "a", "b", "c") var test = 3
|
||||
|
||||
|
||||
func test():
|
||||
pass
|
@@ -0,0 +1,2 @@
|
||||
GDTEST_PARSER_ERROR
|
||||
The "export" keyword was removed in Godot 4. Use an export annotation ("@export", "@export_range", etc.) instead.
|
@@ -0,0 +1 @@
|
||||
@export_tool_button("Click me!") var action
|
@@ -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).
|
@@ -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,3 @@
|
||||
# No colon --v
|
||||
var f = func () -> void
|
||||
pass
|
@@ -0,0 +1,2 @@
|
||||
GDTEST_PARSER_ERROR
|
||||
Expected ":" after lambda declaration.
|
@@ -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.
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user