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

New properties API #5548

Merged
merged 14 commits into from
Sep 18, 2024
Merged

New properties API #5548

merged 14 commits into from
Sep 18, 2024

Conversation

robertbastian
Copy link
Member

@robertbastian robertbastian changed the title Concept: new properties API New properties API Sep 17, 2024
@robertbastian robertbastian marked this pull request as ready for review September 17, 2024 17:51
@robertbastian
Copy link
Member Author

Will fix docs tests after initial review.

};
}

pub use crate::provider::props::BidiClass;
Copy link
Member

Choose a reason for hiding this comment

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

issue: I'd rather not do this; these types are tagged as unstable in the docs.

Can we instead just use regular integers in the data and convert here? we erase the type anyway

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we should consider them stable instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

The reason I moved them is that they have make_ule, and the ULE types should not be stable.

Copy link
Member

Choose a reason for hiding this comment

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

@robertbastian Right, I wish to also consider them stable, which is why I don't want them in the provider module.

Don't worry about make_ule, those are going to go away before 1.0 #5127 . I've been waiting for this PR to land to make that change.

@sffc sffc removed their request for review September 18, 2024 06:17
Copy link
Member

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

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

Overall happy with the direction here, mostly have comments on code organization:

  • I think the properties should all canonically live in crate::props, not under provider. Don't worry about the ULE types, they're going away
  • I think enumerated properties should automatically generate names

Since this is a large PR and unwieldy to review I'm okay merging this with followups.

};
}

pub use crate::provider::props::BidiClass;
Copy link
Member

Choose a reason for hiding this comment

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

@robertbastian Right, I wish to also consider them stable, which is why I don't want them in the provider module.

Don't worry about make_ule, those are going to go away before 1.0 #5127 . I've been waiting for this PR to land to make that change.

Manishearth
Manishearth previously approved these changes Sep 18, 2024
Copy link
Member

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

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

Approving with the two code organization bits as followups. I'm happy to do the props one since I want to touch that code anyway.

@robertbastian
Copy link
Member Author

I think enumerated properties should automatically generate names

If you mean merging EnumeratedProperty, NamedEnumeratedProperty and ParseableEnumeratedProperty, that doesn't work because

  • Script doesn't use NamedEnumeratedProperty/PropertyNames, it uses ScriptMapper to return icu::locale::subtags::Script
  • GeneralCategoryGroup is a pseudo-property, it doesn't implement EnumeratedProperty, but does implement ParseableEnumeratedProperty

@Manishearth
Copy link
Member

If you mean merging EnumeratedProperty, NamedEnumeratedProperty and ParseableEnumeratedProperty, that doesn't work because

I meant having the macro generate names too. Not merging the traits.

@robertbastian robertbastian merged commit 4c28a99 into unicode-org:main Sep 18, 2024
28 checks passed
@Manishearth
Copy link
Member

I think the properties should all canonically live in crate::props, not under provider. Don't worry about the ULE types, they're going away

I'll take on this followup

Manishearth added a commit that referenced this pull request Sep 18, 2024
)

Some progress on #5127. Now
there are only two `make_ule`s in zerovec, for enums.

Followups from #5548
@Manishearth
Copy link
Member

Done in #5555. GeneralCategoryULE's macro sticks around since we've not done #5127 yet, but in the longer run we can get rid of it with a macro.

@robertbastian robertbastian deleted the propapi branch September 19, 2024 17:13
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