Extend the Generator Capabilities for Enum maby use bit selector for types that are written by more than one combinator aka Enum
schema
// Simple Enum Foo
f_a$00 = Foo;
f_b$01 = Foo;
f_c$10 = Foo;
// Simple Enum Foo
b_a$0 = Bar;
b_b$10 = Bar;
b_c$11 = Bar;
// Simple Enum Quz
q_a$11 = Quz;
// Enum A
a$00 = A 1 1;
b$01 = A 1 2;
d$10 = A 2 1;
e$11 {X:#} {Y:#} = A X Y;
tlbc -qv local-enum.tlb
type #1548: `Foo`, arity 0, 3 constructors
constructor `f_a`
f_a$00 = Foo;
begins with {00*}
size =2 (fixed) (any bits)
constructor `f_b`
f_b$01 = Foo;
begins with {01*}
size =2 (fixed) (any bits)
constructor `f_c`
f_c$10 = Foo;
begins with {10*}
size =2 (fixed) (any bits)
(SIMPLE ENUM)
constructor detection: PFX(2)
type size =2 (fixed)
type begins with {0*,10*}
type #1549: `Bar`, arity 0, 3 constructors
constructor `b_a`
b_a$0 = Bar;
begins with {0*}
size =1 (fixed) (any bits)
constructor `b_b`
b_b$10 = Bar;
begins with {10*}
size =2 (fixed) (any bits)
constructor `b_c`
b_c$11 = Bar;
begins with {11*}
size =2 (fixed) (any bits)
(SIMPLE ENUM)
constructor detection: PFX(2)
type size 1..2 (any bits)
type begins with {*}
type #1550: `Quz`, arity 0, 1 constructors
constructor `q_a`
q_a$11 = Quz;
begins with {11*}
size =2 (fixed) (any bits)
(SIMPLE ENUM)
type size =2 (fixed)
type begins with {11*}
type #1551: `A`, arity 2, 4 constructors
constructor `a`
a$00 = A 1 1;
begins with {00*}
admissibility [0000010000000000]
size =2 (fixed) (any bits)
constructor `b`
b$01 = A 1 2;
begins with {01*}
admissibility [0000000001000000]
size =2 (fixed) (any bits)
constructor `d`
d$10 = A 2 1;
begins with {10*}
admissibility [0000001000000000]
size =2 (fixed) (any bits)
constructor `e`
e$11 {X:#} {Y:#} = A X Y;
begins with {11*}
size =2 (fixed) (any bits)
field `X`: # (used=0) (is_nat_subtype=1)
field `Y`: # (used=0) (is_nat_subtype=1)
(ENUM)
constructor detection: PFX(2)
type size =2 (fixed) (any bits)
type begins with {*}
type admissibility [1111111111111111]
References
Extend the Generator Capabilities for Enum maby use bit selector for types that are written by more than one combinator aka Enum
schema
References