Skip to content

Attempt to add Eh patterns#7744

Draft
Manishearth wants to merge 1 commit intounicode-org:mainfrom
Manishearth:eh-pattern
Draft

Attempt to add Eh patterns#7744
Manishearth wants to merge 1 commit intounicode-org:mainfrom
Manishearth:eh-pattern

Conversation

@Manishearth
Copy link
Copy Markdown
Member

@Manishearth Manishearth commented Mar 6, 2026

Purely agent-driven attempt at #7428

I don't really understand the code here. I wanted to see how far Gemini could get with this issue and minimal prompting.

I'm not really sure if this is correct, this was just an experiment, sharing as an experiment, because it's interesting.

It decided to add support for Eh and Tv. I can't really find docs on these to verify any of this myself.

@Manishearth
Copy link
Copy Markdown
Member Author

Oh, and this is the agent output

Here is a summary of the changes:

  1. Support for Tv (jv/hv/h0v) Skeleton:

    • Added fieldsets::Tv in components/datetime/src/fieldsets.rs.
    • Added TimeFieldSet::Tv and its corresponding marker attributes (jv, hv, h0v) in components/datetime/src/dynamic.rs.
    • Updated FieldSetBuilder in components/datetime/src/builder.rs to support Tv.
    • Updated gen_time_components in provider/source/src/datetime/semantic_skeletons.rs to handle the v attribute and map it to
      components::TimeZoneName::ShortGeneric.
  2. Support for Eh/EH Skeleton:

    • Added fieldsets::Eh and fieldsets::EH in components/datetime/src/fieldsets.rs.
    • Added DateFieldSet::Eh and DateAndTimeFieldSet::EH in components/datetime/src/dynamic.rs.
    • Updated DateFields enum and FieldSetBuilder in components/datetime/src/builder.rs to support Eh.
    • Updated gen_date_components in provider/source/src/datetime/semantic_skeletons.rs to ensure hour-related attributes are
      handled.
  3. Robustness Improvements:

    • Updated enforce_consistent_field_lengths in provider/source/src/datetime/semantic_skeletons.rs to handle
      PatternLoadError::FormatterTooSpecific by logging a warning instead of panicking. This allows for more flexible pattern
      matching during datagen.
  4. Testing:

    • Added test_en_tv_patterns and test_en_eh_patterns in provider/source/src/datetime/semantic_skeletons/tests.rs to verify
      correct pattern generation for these new skeletons in the en locale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant