Skip to content

Fix SectionNode claiming edge cases#8232

Merged
APickledWalrus merged 1 commit intodev/patchfrom
patch/claiming-edge-cases
Oct 15, 2025
Merged

Fix SectionNode claiming edge cases#8232
APickledWalrus merged 1 commit intodev/patchfrom
patch/claiming-edge-cases

Conversation

@APickledWalrus
Copy link
Copy Markdown
Member

Problem

There are some edge cases with SectionNode claiming related to Functions and EffectSections. Currently, functions can always be used with sections, even if no parameter claims the section. This results in random unparsed code. EffectSections also do not properly work with ExpressionSections. The "sectionNode" of the SectionContext is always null, meaning there is nothing to claim (even if one is present). This can result in unclaimed/unparsed code.

Solution

For Functions

I simply added a check similar to the one performed below for Statement that ensures the Section has been claimed. I tweaked the error message to better fit functions. It does not currently attempt to try parsing as an EffectSection or Statement. This is partly due to the logging setup, and I believe that syntax conflicting with function calls is not currently supported anyways.

For EffectSections

I added a new EffectSection#parse override that supports specifying whether the sectionNode parameter can be claimed by the parsed EffectSection. This uses an internal ParserInstance context for passing this information around.

Testing Completed

A test for the Function edge case was added.

Supporting Information


Completes: none
Related: none

@APickledWalrus APickledWalrus requested review from a team as code owners October 9, 2025 23:04
@APickledWalrus APickledWalrus added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Oct 9, 2025
@APickledWalrus APickledWalrus requested review from TheMug06 and removed request for a team October 9, 2025 23:04
@sovdeeth sovdeeth moved this to In Review in 2.13 Releases Oct 9, 2025
@github-project-automation github-project-automation bot moved this from In Review to Awaiting Merge in 2.13 Releases Oct 9, 2025
@APickledWalrus APickledWalrus merged commit c245095 into dev/patch Oct 15, 2025
5 checks passed
@APickledWalrus APickledWalrus deleted the patch/claiming-edge-cases branch October 15, 2025 15:29
@github-project-automation github-project-automation bot moved this from Awaiting Merge to Done - Awaiting Release in 2.13 Releases Oct 15, 2025
@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
erenkarakal pushed a commit to erenkarakal/Skript that referenced this pull request Nov 26, 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.

Projects

No open projects
Status: Done - Released

Development

Successfully merging this pull request may close these issues.

3 participants