Fix SectionNode claiming edge cases#8232
Merged
APickledWalrus merged 1 commit intodev/patchfrom Oct 15, 2025
Merged
Conversation
sovdeeth
approved these changes
Oct 9, 2025
Absolutionism
approved these changes
Oct 9, 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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#parseoverride that supports specifying whether thesectionNodeparameter 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