metagen: simplify data tables

This commit is contained in:
Ryan Fleury
2024-02-13 11:16:45 -08:00
parent 742d2387e2
commit 1d9dc2b9a9
12 changed files with 171 additions and 235 deletions
+12 -16
View File
@@ -56,30 +56,26 @@ CTRL_ExceptionCodeKindTable:
COUNT,
}
@table_gen_data(type:U32, fallback:0)
ctrl_exception_code_kind_code_table:
@data(U32) ctrl_exception_code_kind_code_table:
{
`0,`;
@expand(CTRL_ExceptionCodeKindTable a) `$(a.code),`;
`0`;
@expand(CTRL_ExceptionCodeKindTable a) `$(a.code)`;
}
@table_gen_data(type:String8, fallback:`{0}`)
ctrl_exception_code_kind_display_string_table:
@data(String8) ctrl_exception_code_kind_display_string_table:
{
`{0},`;
@expand(CTRL_ExceptionCodeKindTable a) `str8_lit_comp("$(a.display_string)"),`;
`{0}`;
@expand(CTRL_ExceptionCodeKindTable a) `str8_lit_comp("$(a.display_string)")`;
}
@table_gen_data(type:String8, fallback:`{0}`)
ctrl_exception_code_kind_lowercase_code_string_table:
@data(String8) ctrl_exception_code_kind_lowercase_code_string_table:
{
`{0},`;
@expand(CTRL_ExceptionCodeKindTable a) `str8_lit_comp("$(a.lower_name)"),`;
`{0}`;
@expand(CTRL_ExceptionCodeKindTable a) `str8_lit_comp("$(a.lower_name)")`;
}
@table_gen_data(type:B8, fallback:0)
ctrl_exception_code_kind_default_enable_table:
@data(B8) ctrl_exception_code_kind_default_enable_table:
{
`0,`;
@expand(CTRL_ExceptionCodeKindTable a) `$(a.default),`;
`0`;
@expand(CTRL_ExceptionCodeKindTable a) `$(a.default)`;
}