1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

GDScript: Show error on unary operators without argument

This commit is contained in:
George Marques
2021-09-15 11:08:59 -03:00
parent 5a612d61b9
commit d49046938a
11 changed files with 34 additions and 0 deletions

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():
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.