Fix generated `format!` macro call

finchie
Feb 11, 2024, 7:42 AM
MIHGKLMEPO5O6KSXEBOLEPWGUUL3YBNKJC75G34J23EM55BDX2XQC

Dependencies

  • [2] BMUMO42I Add support for inline string and number literals
  • [3] O77KA6C4 Create `fluent_embed` crate
  • [4] 3C3CHSY5 Implement `to_syn` for groups containing simple text messages

Change contents

  • replacement in fluent_embed/src/lib.rs at line 50
    [3.578][3.578:639]()
    // TODO: turn this into a well-formed `match expression`
    [3.578]
    [3.639]
    // TODO: turn this into a well-formed `match` expression
  • replacement in fluent_embed/src/lib.rs at line 60
    [2.384][2.384:507]()
    let mut format_body = proc_macro2::TokenStream::new();
    let mut format_arguments = proc_macro2::TokenStream::new();
    [2.384]
    [2.507]
    let mut format_body = String::new();
    let mut format_arguments = Vec::new();
  • replacement in fluent_embed/src/lib.rs at line 65
    [2.571][2.571:660]()
    PatternElement::TextElement { value } => format_body.extend(quote!(#value)),
    [2.571]
    [2.660]
    PatternElement::TextElement { value } => format_body.push_str(value),
  • replacement in fluent_embed/src/lib.rs at line 68
    [2.792][2.792:902]()
    format_body.extend(quote!({}));
    format_arguments.extend(quote!(#expression));
    [2.792]
    [2.902]
    format_body.push_str("{}");
    format_arguments.push(quote!(#expression));
  • replacement in fluent_embed/src/lib.rs at line 76
    [2.1028][2.1028:1095]()
    parse_quote!(format!(#format_body_literal, #format_arguments))
    [2.1028]
    [2.1095]
    parse_quote!(format!(#format_body_literal, #(#format_arguments),*))