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

More Keyword Tweaks #6694

Merged
merged 5 commits into from
Jul 1, 2024
Merged

More Keyword Tweaks #6694

merged 5 commits into from
Jul 1, 2024

Conversation

APickledWalrus
Copy link
Member

Description

This PR makes some tweaks to the Keyword class to improve simplicity.

I have removed the flatten utility method. Instead, a recursive approach is taken for building keyword(s) from a choice pattern (it will only go one level down from the root for choices). I have replaced GroupKeyword with ChoiceKeyword is a set of the keywords for each choice. The same idea follows that one of the sets of keywords must apply for the input expression to match.

I've also added some overrides to the keyword implementations (idk about the hashcode implementations).

Some brief testing indicated a possible minor performance increase, though the goal is really only to maintain performance (while improving the implementation).


Target Minecraft Versions: any
Requirements: none
Related Issues: none

ChoiceKeywords add support for more advanced choice groups
@APickledWalrus APickledWalrus added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label May 13, 2024
@sovdeeth sovdeeth added the 2.9 Targeting a 2.9.X version release label Jun 30, 2024
@sovdeeth sovdeeth added the feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. label Jul 1, 2024
@sovdeeth sovdeeth merged commit 28fbc6c into dev/feature Jul 1, 2024
5 of 6 checks passed
@APickledWalrus APickledWalrus deleted the feature/more-keyword-tweaks branch October 13, 2024 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.9 Targeting a 2.9.X version release enhancement Feature request, an issue about something that could be improved, or a PR improving something. feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants