node format: Allow naming textures and nodes
We extend the syntax for nodes from:
<node-type> { ... }
to
<node-type> { ... }
<node-type> "name" { ... }
"name"
and for textures from:
<url>
to
<url>
"name" <url>
"name"
where the first is the same as before, the 2nd defines a node or texture and gives it a name while the last references one. Or to give an example:
texture {
bounds: 0 0 10 10;
texture: "foo" url("foo.png");
}
texture "my texture" {
bounds: 20 0 10 10;
texture: "foo";
}
transform {
transform: translate(20, 0);
child: "my texture";
}
This will draw the texture "foo.png" thrice, at (0,0) (20,0) and (40,0).
The intended use for this is both shortening generated node files as well as allowing to write tests that reuse textures or nodes.
Edited by Benjamin Otte