tidying up naming scheme and parameters in helper inspection API; [examples] sketch of type metadata example

This commit is contained in:
Allen Webster
2021-09-17 00:48:06 -07:00
parent fd191a3181
commit b6cbff2eb1
11 changed files with 269 additions and 42 deletions
+56
View File
@@ -0,0 +1,56 @@
/*
** Setup as input to the type metadata example
*/
@type(basic) U32: 4;
@type(basic) F32: 4;
@type(basic) V2F32: 8;
@type(struct)
Circle:
{
r: F32;
pos: V2F32;
}
@type(struct)
RoundedSegment:
{
r: F32;
p1: V2F32;
p2: V2F32;
}
@type(struct)
RoundedPolygon:
{
r: F32;
count: U32;
p: @array(count) V2F32;
}
@type(enum: U32)
Shape:
{
Circle: 1,
Segment: 2,
Polygon: 3,
}
@map(Shape -> `$Type`; complete)
type_info_from_shape:
{
Circle -> Circle,
Segment -> RoundedSegment,
Polygon -> RoundedPolygon,
}
@map(Shape -> U32; default: 0; auto: 64)
max_slot_from_shape:
{
Polygon -> 12,
}
+5
View File
@@ -1,3 +1,6 @@
/*
** Setup as input to the user-errors example
*/
@foo @bar Foo:
{
@@ -6,6 +9,8 @@
1, 2, 3,
}
[50 + 200]
@baz Blah:
{
x100 y200 z300