yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Tim FoleyAllow both traditional and modern property syntax (#1487)09adf10f6

master
393 B30 linesraw
1// property-syntax.slang
2
3// Confirm that property syntax is parsed correctly.
4
5//TEST:SIMPLE:
6
7struct Data
8{
9    int _a;
10    int _b;
11
12    // Traditional syntax
13	property int a
14	{
15		get { return _a; }
16		set(int newValue) { _a = newValue; }
17	}
18
19	// "Modern" syntax
20	property b : int
21	{
22		get { return _b; }
23		set(newValue : int) { _a = newValue; }
24	}
25}
26
27int test(Data d)
28{
29	return d.a + d.b;
30}