Implement type-aware function argument parsing#8098
Merged
sovdeeth merged 13 commits intoSkriptLang:dev/patchfrom Aug 29, 2025
Merged
Implement type-aware function argument parsing#8098sovdeeth merged 13 commits intoSkriptLang:dev/patchfrom
sovdeeth merged 13 commits intoSkriptLang:dev/patchfrom
Conversation
Efnilite
reviewed
Jul 31, 2025
src/main/java/ch/njol/skript/lang/function/FunctionRegistry.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/lang/function/FunctionRegistry.java
Outdated
Show resolved
Hide resolved
Efnilite
reviewed
Jul 31, 2025
1 task
1 task
Efnilite
approved these changes
Aug 8, 2025
Efnilite
reviewed
Aug 10, 2025
sovdeeth
approved these changes
Aug 17, 2025
erenkarakal
pushed a commit
to erenkarakal/Skript
that referenced
this pull request
Nov 26, 2025
* Clean up expression list parsing * Implement type-aware function argument parsing Needs further optimization/cleanup * Optimize OrderedExprInfo creation/usage * Switch to Set of signatures * Correct Unmodifiable annotations * Fix expression list "and" checks * Rename test effect * Actually finish the rename * Add projectile literal test
erenkarakal
pushed a commit
to erenkarakal/Skript
that referenced
this pull request
Nov 26, 2025
* Clean up expression list parsing * Implement type-aware function argument parsing Needs further optimization/cleanup * Optimize OrderedExprInfo creation/usage * Switch to Set of signatures * Correct Unmodifiable annotations * Fix expression list "and" checks * Rename test effect * Actually finish the rename * Add projectile literal test
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
This PR addresses multiple issues. First, list parsing behavior is duplicated within SkriptParser rather than centralized in one method.
Additionally, since function overloading was added, literal parameters (for conflicting literals) would fail to parse properly (that is, as the expected type).
Consider the following example:
Solution
List parsing has been re-written. The underlying code/process is generally the same, just better formatted and organized. The handling of plural types (consider ExprInfo such as
%number/booleans%) has been rewritten to work "properly". Previously, only the first argument was used. Now, the entire array is considered against the parsed expressions:Function argument parsing has also been rewritten. Previously, function arguments were parsed as any possible expression (i.e. expecteing Object as the return type). Now, function arguments are parsed based on the possible parameter types. For all possible signatures, an ExprInfo is created for each parameter index. Consider the following example:
Now, when attempting to parse
test(INPUT)it will only attempt to parseINPUTas a string or boolean, rather than any value.Further testing of performance and stability is needed.
Testing Completed
The
StructFunctiontest has been expanded with a test case for conflicting literal parameters.Supporting Information
Completes: none
Related: none