Skip to content

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
@Efnilite Efnilite requested a review from a team as a code owner March 30, 2025 12:45
@Efnilite Efnilite requested review from APickledWalrus and removed request for a team March 30, 2025 12:45
@Efnilite Efnilite merged commit b25b048 into SkriptLang:dev/patch Mar 30, 2025
5 checks passed
@sovdeeth sovdeeth mentioned this pull request Apr 18, 2025
1 task
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.

3 participants