11use std:: borrow:: Cow ;
22
3- use crate :: svd:: { Access , Device , DimElement , Field , RegisterInfo , RegisterProperties } ;
3+ use crate :: svd:: { Access , Device , Field , RegisterInfo , RegisterProperties } ;
44use html_escape:: encode_text_minimal;
55use inflections:: Inflect ;
66use proc_macro2:: { Ident , Span , TokenStream } ;
@@ -10,8 +10,7 @@ use std::path::{Path, PathBuf};
1010use svd_rs:: { MaybeArray , Peripheral , PeripheralInfo } ;
1111
1212use syn:: {
13- punctuated:: Punctuated , token:: PathSep , AngleBracketedGenericArguments , GenericArgument , Lit ,
14- LitInt , PathArguments , PathSegment , Token , Type , TypePath ,
13+ punctuated:: Punctuated , token:: PathSep , Lit , LitInt , PathArguments , PathSegment , Type , TypePath ,
1514} ;
1615
1716use anyhow:: { anyhow, bail, Result } ;
@@ -36,8 +35,6 @@ pub struct Config {
3635 #[ cfg_attr( feature = "serde" , serde( default ) ) ]
3736 pub make_mod : bool ,
3837 #[ cfg_attr( feature = "serde" , serde( default ) ) ]
39- pub array_proxy : bool ,
40- #[ cfg_attr( feature = "serde" , serde( default ) ) ]
4138 pub ignore_groups : bool ,
4239 #[ cfg_attr( feature = "serde" , serde( default ) ) ]
4340 pub keep_list : bool ,
@@ -118,7 +115,6 @@ impl Default for Config {
118115 atomics_feature : None ,
119116 generic_mod : false ,
120117 make_mod : false ,
121- array_proxy : false ,
122118 ignore_groups : false ,
123119 keep_list : false ,
124120 strict : false ,
@@ -419,30 +415,11 @@ pub fn new_syn_u32(len: u32, span: Span) -> syn::Expr {
419415 } )
420416}
421417
422- pub fn array_proxy_type ( ty : Type , array_info : & DimElement ) -> Type {
423- let span = Span :: call_site ( ) ;
424- let inner_path = GenericArgument :: Type ( ty) ;
425- let mut args = Punctuated :: new ( ) ;
426- args. push ( inner_path) ;
427- args. push ( GenericArgument :: Const ( new_syn_u32 ( array_info. dim , span) ) ) ;
428- args. push ( GenericArgument :: Const ( syn:: Expr :: Lit ( syn:: ExprLit {
429- attrs : Vec :: new ( ) ,
430- lit : syn:: Lit :: Int ( hex ( array_info. dim_increment as u64 ) ) ,
431- } ) ) ) ;
432- let arguments = PathArguments :: AngleBracketed ( AngleBracketedGenericArguments {
433- colon2_token : None ,
434- lt_token : Token ! [ <] ( span) ,
435- args,
436- gt_token : Token ! [ >] ( span) ,
437- } ) ;
438-
439- let mut segments = Punctuated :: new ( ) ;
440- segments. push ( path_segment ( Ident :: new ( "crate" , span) ) ) ;
441- segments. push ( PathSegment {
442- ident : Ident :: new ( "ArrayProxy" , span) ,
443- arguments,
444- } ) ;
445- Type :: Path ( type_path ( segments) )
418+ pub fn zst_type ( ) -> Type {
419+ Type :: Tuple ( syn:: TypeTuple {
420+ paren_token : syn:: token:: Paren :: default ( ) ,
421+ elems : Punctuated :: new ( ) ,
422+ } )
446423}
447424
448425pub fn name_to_ty ( name : & str ) -> Type {
0 commit comments