add support for custom debug/display formatting of #[hdl] structs/enums
All checks were successful
/ test (pull_request) Successful in 4m6s
/ test (push) Successful in 4m41s

also cleans up default debug formatting to use the struct/enum name
(or MaskType<StructName>) instead of the implementation detail type name.
This commit is contained in:
Jacob Lifshay 2026-04-30 23:10:49 -07:00
parent 402f457c68
commit 8e4eeef723
Signed by: programmerjake
SSH key fingerprint: SHA256:HnFTLGpSm4Q4Fj502oCFisjZSoakwEuTsJJMSke63RQ
18 changed files with 773 additions and 63 deletions

View file

@ -42,6 +42,7 @@ pub(crate) trait CustomToken:
mod kw {
pub(crate) use syn::token::Extern as extern_;
pub(crate) use syn::token::Type as type_;
macro_rules! custom_keyword {
($kw:ident) => {
@ -75,6 +76,8 @@ mod kw {
custom_keyword!(cmp_eq);
custom_keyword!(connect_inexact);
custom_keyword!(custom_bounds);
custom_keyword!(custom_debug);
custom_keyword!(custom_sim_display);
custom_keyword!(flip);
custom_keyword!(get);
custom_keyword!(hdl);
@ -83,6 +86,8 @@ mod kw {
custom_keyword!(input);
custom_keyword!(instance);
custom_keyword!(m);
custom_keyword!(mask_sim);
custom_keyword!(mask_type);
custom_keyword!(memory);
custom_keyword!(memory_array);
custom_keyword!(memory_with_init);