fn create_pr_type(pr_type: &str, streams: Vec<TokenStream>) -> TokenStream {
    let mut tokens = Vec::<TokenStream>::new();

    let match_name = match pr_type {
        "cardinal" => quote! { PRS_CARDINAL },
        "ordinal" => quote! { PRS_ORDINAL },
        _ => panic!("Unknown plural rule type"),
    };

    for func in &streams {
        tokens.push(func.clone());
    }
    quote! { pub const #match_name: &[(LanguageIdentifier, PluralRule)] = &[ #(#tokens),* ]; }
}
// Function wraps all match statements for plural rules in a match for ordinal and cardinal rules
Function wraps all match statements for plural rules in a match for ordinal and cardinal rules
Function wraps all match statements for plural rules in a match for ordinal and cardinal rules
fn create_pr_type(pr_type: &str, streams: Vec<TokenStream>) -> TokenStream {
    let mut tokens = Vec::<TokenStream>::new();
    let match_name = match pr_type {
        "cardinal" => quote! { PRS_CARDINAL },
        "ordinal" => quote! { PRS_ORDINAL },
        _ => panic!("Unknown plural rule type"),
    };
    for func in &streams {
        tokens.push(func.clone());
    }
    quote! { pub const #match_name: &[(LanguageIdentifier, PluralRule)] = &[ #(#tokens),* ]; }
}
fn create_pr_type ( pr_type : & str , streams : Vec < TokenStream > ) -> TokenStream { let mut tokens = Vec :: < TokenStream > :: new ( ) ; let match_name = match pr_type { " " => quote ! { PRS_CARDINAL } , " " => quote ! { PRS_ORDINAL } , _ => panic ! ( " " ) , } ; for func in & streams { tokens . push ( func . clone ( ) ) ; } quote ! { pub const match_name [ ( LanguageIdentifier PluralRule ) ] [ ( tokens ) ] } }
Function wraps all match statements for plural rules in a match for ordinal and cardinal rules
Function wraps all match statements for plural rules in a match for ordinal and cardinal rules
pr_type
&str
streams
Vec<TokenStream>
pr_type
&str
streams
Vec<TokenStream>