Skip to content

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

Merged
Efnilite merged 3 commits into
SkriptLang:dev/patchfrom
sovdeeth:fix/plural-functions-treated-as-single
Mar 30, 2025
Merged

Fix non-single functions being parsed for single-only expression infos#7716
Efnilite merged 3 commits into
SkriptLang:dev/patchfrom
sovdeeth:fix/plural-functions-treated-as-single

Conversation

@sovdeeth
Copy link
Copy Markdown
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
Copy Markdown
Member Author

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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, Pesekjak and Romitou 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
@sovdeeth sovdeeth mentioned this pull request Apr 18, 2025
1 task
erenkarakal pushed a commit to erenkarakal/Skript that referenced this pull request Nov 26, 2025
SkriptLang#7716)

* Update SkriptParser.java

* use alternative error message

---------

Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
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