Debian Codegraph @

modules/gdscript/tests/scripts/parser/features/dollar_node_paths.gd

raw
1 extends Node
2
3
4 func test():
5 # Create the required node structure.
6 var hello = Node.new()
7 hello.name = "Hello"
8 @warning_ignore("unsafe_call_argument")
9 add_child(hello)
10 var world = Node.new()
11 world.name = "World"
12 @warning_ignore("unsafe_call_argument")
13 hello.add_child(world)
14
15 # All the ways of writing node paths below with the `$` operator are valid.
16 # Results are assigned to variables to avoid warnings.
17 var __ = $Hello
18 __ = $"Hello"
19 __ = $Hello/World
20 __ = $"Hello/World"
21 __ = $"Hello/.."
22 __ = $"Hello/../Hello/World"