Improve Fluent syntax error spans

finchie
Apr 10, 2025, 5:11 AM
FF67HCOFIP6LBJCPUC7PBL74KDFZEFP6NELQPILRIFLYHV3JQWLAC

Dependencies

  • [2] 3NMKD6I5 Refactor `Localize` trait to use `std::io::Write`
  • [3] QFPQZR4K Refactor `fluent_embed`
  • [4] F5LG7WEN Emit compilation errors from Fluent source code
  • [5] 2SITVDYW Handle common errors in Fluent code
  • [*] 5TEX4MNU Split `fluent_embed` into `group` and `parse` modules

Change contents

  • replacement in fluent_embed_derive/src/fluent/mod.rs at line 81
    [3.2020][3.2020:2079]()
    span: SourceSpan::from(error.pos),
    [3.2020]
    [3.2079]
    span: SourceSpan::from(error.slice.unwrap_or(error.pos)),
  • replacement in fluent_embed_derive/src/fluent/ast.rs at line 58
    [3.3625][2.2577:2634]()
    // TODO: handle this as an error
    [3.3625]
    [2.2634]
    // The parser should guarantee a default arm is available