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

Fix non-single functions being parsed for single-only expression infos #7716

Open
wants to merge 2 commits into
base: dev/patch
Choose a base branch
from

Conversation

sovdeeth
Copy link
Member

Description

Forces the parser to check the plurality of a function before returning it as a valid expression for a given exprInfo.
Also updates the other errors related to plural/single values that weren't being printed and were poorly written.

Before:
image
Note that the matched pattern only accepts a single number, but since the implementation uses getArray, no issue occurs.
This causes exceptions when used with implementations that use getSingle().

After:
image


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

@sovdeeth sovdeeth added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Mar 16, 2025
@sovdeeth sovdeeth requested a review from a team March 16, 2025 19:34
@sovdeeth
Copy link
Member Author

image
Alternative error message. I think it's better but it might be a bit confusing
let me know

Copy link
Member

@Efnilite Efnilite left a comment

Choose a reason for hiding this comment

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

i think the second one is better if you explain that it's for this specific expression, so e.g.
In this expression, '{a::*}' can only accept a single number, not more.

@sovdeeth
Copy link
Member Author

i prefer the first error message :)

In case it changes your opinion, it has to be changed to this syntax as the parent syntax isn't necessarily an expression

@Efnilite
Copy link
Member

i prefer the first error message :)

In case it changes your opinion, it has to be changed to this syntax as the parent syntax isn't necessarily an expression

changed my mind after posting, that's fine to me

@sovdeeth sovdeeth requested review from a team, Romitou and Pesekjak and removed request for a team March 17, 2025 05:50
@sovdeeth sovdeeth added the patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version. label Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants