Debian Codegraph @

src/test/01-Basic/217-vec-fields-access.ck

raw
1 // dot member
2 // related: https://github.com/ccrma/chuck/issues/378
3
4 // a vec4
5 @(1,2,3,4) => vec4 v4;
6
7 fun vec4 r()
8 {
9 // assign fields in v4
10 5 => v4.x;
11 6 => v4.y;
12 7 => v4.z;
13 1 +=> v4.w;
14
15 // return
16 return v4;
17 }
18
19 // do this a lot (used to stack overflow)
20 for( int i; i < 100000; i++ )
21 {
22 // call and access a field (make sure this cleans up properly)
23 r().x;
24 }
25
26 <<< r().x, r().y, r().z, r().w >>>;