GDScript: Allow string keys on Lua-style dictionaries
Which is useful when the key isn't a valid identifier, such as keys with spaces or numeric keys.
This commit is contained in:
parent
32f8f74d83
commit
5d31ce4b16
10 changed files with 48 additions and 4 deletions
|
|
@ -0,0 +1,6 @@
|
|||
func test():
|
||||
var lua_dict = {
|
||||
a = 1,
|
||||
b = 2,
|
||||
a = 3, # Duplicate isn't allowed.
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Key "a" was already used in this dictionary (at line 3).
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
func test():
|
||||
var lua_dict_with_string = {
|
||||
a = 1,
|
||||
b = 2,
|
||||
"a" = 3, # Duplicate isn't allowed.
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Key "a" was already used in this dictionary (at line 3).
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
func test():
|
||||
var python_dict = {
|
||||
"a": 1,
|
||||
"b": 2,
|
||||
"a": 3, # Duplicate isn't allowed.
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_ANALYZER_ERROR
|
||||
Key "a" was already used in this dictionary (at line 3).
|
||||
Loading…
Add table
Add a link
Reference in a new issue