blob: e0356fa33a3d6ed5b51fe54d0ea3651a8f38343e [file] [log] [blame]
James Kuszmaul8e62b022022-03-22 09:33:25 -07001enum Color:ubyte (bit_flags) {
2 Red = 0, // color Red = (1u << 0)
3 /// \brief color Green
4 /// Green is bit_flag with value (1u << 1)
5 Green,
6 /// \brief color Blue (1u << 3)
7 Blue = 3,
8}
9
10struct Test { a:short; b:byte; }
11
12struct Vec3 (force_align: 8) {
13 x:float;
14 y:float;
15 z:float;
16 test1:double;
17 test2:Color;
18 test3:Test;
19}
20
21/// an example documentation comment: "monster object"
22table Monster {
23 pos:Vec3 (id: 0);
24 hp:short = 100 (id: 2);
25 mana:short = 150 (id: 1);
26 name:string (id: 3, key);
27 color:Color = Blue (id: 6);
28 inventory:[ubyte] (id: 5);
29 testarrayoftables:[Monster] (id: 4);
30}
31
32root_type Monster;