Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make an IxdtfParser type #5736

Merged
merged 4 commits into from
Oct 29, 2024
Merged

Conversation

robertbastian
Copy link
Member

Based on #5735

sffc
sffc previously approved these changes Oct 25, 2024
Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Praise: Thanks for keeping the function names the same so it is easy to review.

@robertbastian
Copy link
Member Author

Hmm, how do I load all AnyCalendar data upfront?

@sffc
Copy link
Member

sffc commented Oct 28, 2024

@sffc
Copy link
Member

sffc commented Oct 28, 2024

Oh, since it is cross-crate, you will also need the AnyCalendarLoader thing.

@sffc
Copy link
Member

sffc commented Oct 28, 2024

Oh, but you don't know the calendar until parsing time. Hmm.

Easy way out is to pass the AnyCalendar provider into the parse function, but that's annoying.

Maybe you can save a closure that calls the AnyCalendar constructor as a field of the parser? You'd need to put a lifetime on the parser object, I think.

@sffc
Copy link
Member

sffc commented Oct 28, 2024

Or you could eagerly load all the markers into payloads and then make your own internal DataProvider that reads those payloads when calling AnyCalendar::try_new_unstable. Hmm. Maybe we want that to be a type in the icu_calendar crate, since it seems kind-of silly that AnyCalendar::new might need to load the same payload over and over, and you can't save it between loads.

#5739

@sffc
Copy link
Member

sffc commented Oct 29, 2024

#5740

@robertbastian robertbastian requested a review from sffc October 29, 2024 16:21
@robertbastian robertbastian merged commit 34807e6 into unicode-org:main Oct 29, 2024
28 checks passed
@robertbastian robertbastian deleted the parser branch October 29, 2024 17:52
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.

2 participants