Skip to content

Commit f836958

Browse files
Fix nested unique name % (#303)
1 parent 48dd006 commit f836958

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

gdtoolkit/parser/gdscript.lark

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ _simple_lambda_stmt: single_lambda_stmt (";" single_lambda_stmt)* [";"]
263263
HEX.2: /-?0x[a-fA-F0-9][a-fA-F0-9_]*/
264264
BIN.2: /-?0b[01][01_]*/
265265
get_node: "$" (path | string | unique_node_path)
266-
!path: NAME ("/" NAME)*
266+
!path: NAME ("/" "%"? NAME)*
267267
!unique_node_path: "%" (path | REGULAR_STRING)
268268
array: "[" [type_cast ("," type_cast)* [trailing_comma]] "]"
269269
trailing_comma: ","

tests/formatter/input-output-pairs/simple_atom_expressions.in.gd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ func foo():
2222
var xc=%UniqueNodeName
2323
var xd=%UniqueNodeName/Xyz
2424
var xe=%"a/b/c"
25+
var xf=%UniqueNodeName/%AnotherUniqueNodeName

tests/formatter/input-output-pairs/simple_atom_expressions.out.gd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ func foo():
2323
var xc = %UniqueNodeName
2424
var xd = %UniqueNodeName/Xyz
2525
var xe = %"a/b/c"
26+
var xf = %UniqueNodeName/%AnotherUniqueNodeName

tests/valid-gd-scripts/unique_node_name.gd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ func foo():
44
var x = $%UniqueNodeName
55
var y = %UniqueNodeName
66
var z = %"a/b/c"
7+
var w = %UniqueNodeName/%AnotherUniqueNodeName

0 commit comments

Comments
 (0)