Namespace leex/yecc modules to localize_* to coexist with ex_cldr#40
Conversation
localize's parsers were extracted from ex_cldr with their module names intact (rbnf_parser, plural_rules_lexer, ...), so an app that depends on both localize (e.g. via ex_money 6) and ex_cldr/ex_cldr_numbers fails `mix release` with "Duplicated modules" — the BEAM has one flat module namespace and release assembly rejects the clash. Renaming the grammar files (module name = filename for leex/yecc) with a localize_ prefix and updating the 12 call sites resolves it; full suite passes unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JUoqST4frEDRNjMyVnKZhT
|
Thanks very much @jerryluk, you're right - I should have changed these module names but because they are in Erlang-land I missed them during the sweep. And yes, now some divergence - particularly in I'll get a new release out by the end of the weekend. |
|
I've published localize version 0.49.0 with the following changelog entry: [0.49.0] — July 12th, 2026Fixed
Thanks again for the PR. |
Problem
localize's grammar modules were extracted from ex_cldr with their module names intact —
rbnf_parser,rbnf_lexer,plural_rules_parser,plural_rules_lexer,decimal_formats_parser,decimal_formats_lexer,date_time_format_lexer. An application that depends on both localize (e.g. via ex_money >= 6) and ex_cldr/ex_cldr_numbers (still common forCldr.Number, territories, locale display) cannot assemble a release:This is invisible in dev/test (the BEAM just loads one of them) and only surfaces at
mix release, so it tends to be discovered late, in deploy pipelines.Change
Mechanical rename of the
src/grammar files to alocalize_prefix (module name = filename for leex/yecc) plus the 12 internal call sites and one test assertion that pattern-matches the yecc error tuple. The full suite passes unchanged (27,910 tests).Happy to adjust naming if you'd prefer a different prefix. Found while upgrading ex_money 5→6 in an app that keeps ex_cldr for its own formatting.
🤖 Generated with Claude Code
https://claude.ai/code/session_01JUoqST4frEDRNjMyVnKZhT