Overview
There are three features I feel would be really nice to have
The ability to split definitions across multiple files for organizational purposes
The ability to define a Template definition for generic types
The ability to specify definitions and members there of conditionally
I group these into one because depending on their implementation they can have significant overlap.
I had at least a preliminary plan for the implementation of each
Merging
Change the zngur_def::ZngurFile::types member form a Vec to an IndexMap that maps a RustType to its ZngurType
change add_to_zngur_file to check if it's type is present already and if it is merge
Confirm matching layout
Append non overlapping fields and Well Known Traits
Append new member functions
Error on conflict
Allow specifying multiple input files to parse, and are considered to be concatenated together
Template Types
syntax similar to
type <T > :: std:: option:: Option <T > {
#layout ( size = { T . size } , align = { T . align } )
}
type<T , E > :: std:: result:: Result <T , E > {
#layout ( size = { max ( T . size , E . size ) } , align = { max ( T . align , E . align ) } )
}
type<T > crate :: SomeWrapper <T > {
#layout ( size = { T . size + 12 } , align = 8 )
}
Templates are expanded last, after aliases, ONLY if a field or member function references a type that is not already defined
Alternatively , Templates are expanded for every use but are merged with existing definitions deferring to the explicit definitions on conflict
Conditional definition
Use familiar #[cfg(target = "x86_64")] syntax
Expanded using Cargo ENV similar to cxx
evaluate after parse to remove non matching definitions
Questions
I'd like some input on if these features fit within Zugur and if so what they should look like.
Overview
There are three features I feel would be really nice to have
I group these into one because depending on their implementation they can have significant overlap.
I had at least a preliminary plan for the implementation of each
Merging
zngur_def::ZngurFile::typesmember form aVecto anIndexMapthat maps aRustTypeto itsZngurTypeadd_to_zngur_fileto check if it's type is present already and if it is mergeTemplate Types
Conditional definition
#[cfg(target = "x86_64")]syntaxQuestions
I'd like some input on if these features fit within Zugur and if so what they should look like.
#ifcfg /* ...*/ #endif(not sure I'd prefer that thoughmin,max+,-?*?/?)