pub fn gen_fn(streams: BTreeMap<String, Vec<TokenStream>>, vr: &str) -> TokenStream {
    let ignore_noncritical_errors = quote! {
        #![allow(unused_variables, unused_parens)]
        #![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp))]
        #![cfg_attr(feature = "cargo-clippy", allow(clippy::unreadable_literal))]
        #![cfg_attr(feature = "cargo-clippy", allow(clippy::nonminimal_bool))]
    };
    let use_statements = quote! {
        use super::operands::PluralOperands;
        use super::PluralCategory;
        use unic_langid::LanguageIdentifier;
        use unic_langid::subtags;
    };
    let langid_macro = quote! {
        macro_rules! langid {
            ($lang:expr, $script:expr, $region:expr) => {
                {
                    unsafe {
                        LanguageIdentifier::from_raw_parts_unchecked(
                            $lang,
                            $script,
                            $region,
                            None,
                        )
                    }
                }
            };
        }
    };
    let plural_function = quote! { pub type PluralRule = fn(&PluralOperands) -> PluralCategory; };
    let num: isize = vr.parse().unwrap();
    let ver = Literal::u64_unsuffixed(num as u64);
    let version = quote! { pub static CLDR_VERSION: usize = #ver; };
    let head = quote! { #ignore_noncritical_errors #use_statements #plural_function #version #langid_macro };
    let mut tokens = Vec::<TokenStream>::new();
    for (pr_type, stream) in streams {
        tokens.push(create_pr_type(&pr_type, stream));
    }
    let prs = quote! { #(#tokens)* };
    quote! { #head #prs }
}
/// Generates the complete TokenStream for the generated Rust code. This wraps the head and tail of the .rs file around the generated CLDR expressions.
Generates the complete TokenStream for the generated Rust code. This wraps the head and tail of the .rs file around the generated CLDR expressions.
Generates the complete TokenStream for the generated Rust code . This wraps the head and tail of the . rs file around the generated CLDR expressions .
pub fn gen_fn(streams: BTreeMap<String, Vec<TokenStream>>, vr: &str) -> TokenStream {
    let ignore_noncritical_errors = quote! {
        #![allow(unused_variables, unused_parens)]
        #![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp))]
        #![cfg_attr(feature = "cargo-clippy", allow(clippy::unreadable_literal))]
        #![cfg_attr(feature = "cargo-clippy", allow(clippy::nonminimal_bool))]
    };
    let use_statements = quote! {
        use super::operands::PluralOperands;
        use super::PluralCategory;
        use unic_langid::LanguageIdentifier;
        use unic_langid::subtags;
    };
    let langid_macro = quote! {
        macro_rules! langid {
            ($lang:expr, $script:expr, $region:expr) => {
                {
                    unsafe {
                        LanguageIdentifier::from_raw_parts_unchecked(
                            $lang,
                            $script,
                            $region,
                            None,
                        )
                    }
                }
            };
        }
    };
    let plural_function = quote! { pub type PluralRule = fn(&PluralOperands) -> PluralCategory; };
    let num: isize = vr.parse().unwrap();
    let ver = Literal::u64_unsuffixed(num as u64);
    let version = quote! { pub static CLDR_VERSION: usize = #ver; };
    let head = quote! { #ignore_noncritical_errors #use_statements #plural_function #version #langid_macro };
    let mut tokens = Vec::<TokenStream>::new();
    for (pr_type, stream) in streams {
        tokens.push(create_pr_type(&pr_type, stream));
    }
    let prs = quote! { #(#tokens)* };
    quote! { #head #prs }
}
pub fn gen_fn ( streams : BTreeMap < String , Vec < TokenStream > > , vr : & str ) -> TokenStream { let ignore_noncritical_errors = quote ! { [ allow ( unused_variables unused_parens ) ] [ cfg_attr ( feature " " allow ( clippy float_cmp ) ) ] [ cfg_attr ( feature " " allow ( clippy unreadable_literal ) ) ] [ cfg_attr ( feature " " allow ( clippy nonminimal_bool ) ) ] } ; let use_statements = quote ! { use super operands PluralOperands use super PluralCategory use unic_langid LanguageIdentifier use unic_langid subtags } ; let langid_macro = quote ! { macro_rules langid { ( $ lang expr $ script expr $ region expr ) { { unsafe { LanguageIdentifier from_raw_parts_unchecked ( $ lang $ script $ region None ) } } } } } ; let plural_function = quote ! { pub type PluralRule fn ( PluralOperands ) PluralCategory } ; let num : isize = vr . parse ( ) . unwrap ( ) ; let ver = Literal :: u64_unsuffixed ( num as u64 ) ; let version = quote ! { pub static CLDR_VERSION usize ver } ; let head = quote ! { ignore_noncritical_errors use_statements plural_function version langid_macro } ; let mut tokens = Vec :: < TokenStream > :: new ( ) ; for ( pr_type , stream ) in streams { tokens . push ( create_pr_type ( & pr_type , stream ) ) ; } let prs = quote ! { ( tokens ) } ; quote ! { head prs } }
Generates the complete TokenStream for the generated Rust code.
Generates the complete TokenStream for the generated Rust code .
streams
BTreeMap<String, Vec<TokenStream>>
vr
&str
streams
BTreeMap<String, Vec<TokenStream>>
vr
&str