Skip to content

Conversation

@APickledWalrus
Copy link
Member

Problem

When attempting to parse function arguments, SkriptParser uses a "shortcut" to determine whether parsing the input as a single expression is necessary. Those cases were determined to be:

  • The function has only 1 parameter
  • The function has only 1 required parameter (e.g. all others have default values)

However, I failed to consider the case that a function might have 0 required parameters. For a function like that, with multiple parameters that are all optional, the case where that function is called with only one argument could not be parsed properly.

Solution

This is a single-character fix so that single expression parsing is also attempted for functions with 0 minimum arguments.

Testing Completed

I have implemented a regression test for this behavior. I confirmed that it failed before the fix (with the same error as the reported issue).

Supporting Information


Completes: #8187
Related: none

@APickledWalrus APickledWalrus requested review from a team as code owners September 13, 2025 15:56
@APickledWalrus APickledWalrus requested review from UnderscoreTud and removed request for a team September 13, 2025 15:56
@APickledWalrus APickledWalrus added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Sep 13, 2025
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Sep 13, 2025
@APickledWalrus APickledWalrus linked an issue Sep 13, 2025 that may be closed by this pull request
1 task
@skriptlang-automation skriptlang-automation bot added patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version. and removed needs reviews A PR that needs additional reviews labels Sep 13, 2025
@sovdeeth sovdeeth moved this to In Review in 2.13 Releases Sep 13, 2025
@sovdeeth sovdeeth moved this from In Review to Awaiting Merge in 2.13 Releases Sep 13, 2025
@Absolutionism Absolutionism merged commit 75e4ddb into SkriptLang:dev/patch Sep 17, 2025
5 checks passed
@skriptlang-automation skriptlang-automation bot added the completed The issue has been fully resolved and the change will be in the next Skript update. label Sep 17, 2025
@github-project-automation github-project-automation bot moved this from Awaiting Merge to Done - Awaiting Release in 2.13 Releases Sep 17, 2025
@skriptlang-automation skriptlang-automation bot removed the patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version. label Sep 17, 2025
sovdeeth added a commit that referenced this pull request Oct 1, 2025
* Swap reset and delete errors in EffChange (#8177)

swap reset and delete errors

* Fix improper grammar in update block syntax (#8072)

Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>

* Fix Incorrect Variable Change Queue Processing (#8182)

Fix incorrect change processing order

* Change registerExpression() parameter name (#8180)

change parameter name

* Move EvtRealTime to main thread (#8185)

* Fix type-aware function parsing for functions with only optional arguments (#8189)

Account for functions with all optional parameters

* Properly parse exprsecs in function calls (#8199)

modify section context when parsing functions

* add runtime error when EffSort aborts due to null values.

* catch runtime errors
@sovdeeth sovdeeth moved this from Done - Awaiting Release to Done - Released in 2.13 Releases Oct 15, 2025
erenkarakal pushed a commit to erenkarakal/Skript that referenced this pull request Nov 26, 2025
)

* Swap reset and delete errors in EffChange (SkriptLang#8177)

swap reset and delete errors

* Fix improper grammar in update block syntax (SkriptLang#8072)

Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>

* Fix Incorrect Variable Change Queue Processing (SkriptLang#8182)

Fix incorrect change processing order

* Change registerExpression() parameter name (SkriptLang#8180)

change parameter name

* Move EvtRealTime to main thread (SkriptLang#8185)

* Fix type-aware function parsing for functions with only optional arguments (SkriptLang#8189)

Account for functions with all optional parameters

* Properly parse exprsecs in function calls (SkriptLang#8199)

modify section context when parsing functions

* add runtime error when EffSort aborts due to null values.

* catch runtime errors
erenkarakal pushed a commit to erenkarakal/Skript that referenced this pull request Nov 26, 2025
)

* Swap reset and delete errors in EffChange (SkriptLang#8177)

swap reset and delete errors

* Fix improper grammar in update block syntax (SkriptLang#8072)

Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>

* Fix Incorrect Variable Change Queue Processing (SkriptLang#8182)

Fix incorrect change processing order

* Change registerExpression() parameter name (SkriptLang#8180)

change parameter name

* Move EvtRealTime to main thread (SkriptLang#8185)

* Fix type-aware function parsing for functions with only optional arguments (SkriptLang#8189)

Account for functions with all optional parameters

* Properly parse exprsecs in function calls (SkriptLang#8199)

modify section context when parsing functions

* add runtime error when EffSort aborts due to null values.

* catch runtime errors
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. completed The issue has been fully resolved and the change will be in the next Skript update.

Projects

No open projects
Status: Done - Released

Development

Successfully merging this pull request may close these issues.

Functions behave inappropriately with Auto-Args

4 participants