@@ -257,7 +257,8 @@ pub(crate) fn compile_mir(mir: &AscentMir, is_ascent_run: bool) -> proc_macro2::
257257
258258 let mut rel_codegens = vec ! [ ] ;
259259 for rel in mir. relations_ir_relations . keys ( ) {
260- let macro_path = & mir. relations_metadata [ rel] . ds_macro_path ;
260+ let Some ( ds_attr) = & mir. relations_metadata [ rel] . ds_attr else { continue } ;
261+ let macro_path = & ds_attr. path ;
261262 let macro_input = rel_ds_macro_input ( rel, mir) ;
262263 rel_codegens. push ( quote_spanned ! { macro_path. span( ) => #macro_path:: rel_codegen!{ #macro_input} } ) ;
263264 }
@@ -341,12 +342,16 @@ pub(crate) fn compile_mir(mir: &AscentMir, is_ascent_run: bool) -> proc_macro2::
341342}
342343
343344fn rel_ind_common_type ( rel : & RelationIdentity , mir : & AscentMir ) -> Type {
344- if rel. is_lattice {
345- parse_quote ! { ( ) }
346- } else {
347- let macro_path = & mir. relations_metadata [ rel] . ds_macro_path ;
348- let macro_input = rel_ds_macro_input ( rel, mir) ;
349- parse_quote_spanned ! { macro_path. span( ) => #macro_path:: rel_ind_common!( #macro_input) }
345+ match & mir. relations_metadata [ rel] . ds_attr {
346+ None => {
347+ assert ! ( rel. is_lattice) ;
348+ parse_quote ! { ( ) }
349+ } ,
350+ Some ( ds_attr) => {
351+ let macro_path = & ds_attr. path ;
352+ let macro_input = rel_ds_macro_input ( rel, mir) ;
353+ parse_quote_spanned ! { macro_path. span( ) => #macro_path:: rel_ind_common!( #macro_input) }
354+ } ,
350355 }
351356}
352357
@@ -376,7 +381,7 @@ fn rel_index_type(rel: &IrRelation, mir: &AscentMir) -> Type {
376381 } ;
377382 syn:: parse2 ( res) . unwrap ( )
378383 } else {
379- let macro_path = & mir. relations_metadata [ & rel. relation ] . ds_macro_path ;
384+ let macro_path = & mir. relations_metadata [ & rel. relation ] . ds_attr . as_ref ( ) . unwrap ( ) . path ;
380385 let span = macro_path. span ( ) ;
381386 let macro_input = rel_ds_macro_input ( & rel. relation , mir) ;
382387 if rel. is_full_index ( ) {
@@ -391,16 +396,20 @@ fn rel_index_type(rel: &IrRelation, mir: &AscentMir) -> Type {
391396fn rel_type ( rel : & RelationIdentity , mir : & AscentMir ) -> Type {
392397 let field_types = tuple_type ( & rel. field_types ) ;
393398
394- if rel. is_lattice {
395- if mir. is_parallel {
396- parse_quote ! { :: ascent:: boxcar:: Vec <:: std:: sync:: RwLock <#field_types>>}
397- } else {
398- parse_quote ! { :: std:: vec:: Vec <#field_types>}
399- }
400- } else {
401- let macro_path = & mir. relations_metadata [ rel] . ds_macro_path ;
402- let macro_input = rel_ds_macro_input ( rel, mir) ;
403- parse_quote_spanned ! { macro_path. span( ) => #macro_path:: rel!( #macro_input) }
399+ match & mir. relations_metadata [ rel] . ds_attr {
400+ None => {
401+ assert ! ( rel. is_lattice) ;
402+ if mir. is_parallel {
403+ parse_quote ! { :: ascent:: boxcar:: Vec <:: std:: sync:: RwLock <#field_types>>}
404+ } else {
405+ parse_quote ! { :: std:: vec:: Vec <#field_types>}
406+ }
407+ } ,
408+ Some ( ds_attr) => {
409+ let macro_path = & ds_attr. path ;
410+ let macro_input = rel_ds_macro_input ( rel, mir) ;
411+ parse_quote_spanned ! { macro_path. span( ) => #macro_path:: rel!( #macro_input) }
412+ } ,
404413 }
405414}
406415
@@ -416,7 +425,7 @@ fn rel_ds_macro_input(rel: &RelationIdentity, mir: &AscentMir) -> TokenStream {
416425 . iter ( )
417426 . sorted_by_key ( |r| & r. indices )
418427 . map ( |ir_rel| rel_index_to_macro_input ( & ir_rel. indices ) ) ;
419- let args = & mir. relations_metadata [ rel] . ds_macro_args ;
428+ let args = & mir. relations_metadata [ rel] . ds_attr . as_ref ( ) . expect ( "must have the ds attribute" ) . args ;
420429 let par: Ident = if mir. is_parallel {
421430 parse_quote_spanned ! { span=> par}
422431 } else {
0 commit comments