Lower implicit priority for syntaxes involving regular expressions#8536
Merged
UnderscoreTud merged 2 commits intoSkriptLang:dev/patchfrom Apr 15, 2026
Merged
Conversation
APickledWalrus
approved these changes
Apr 13, 2026
Member
APickledWalrus
left a comment
There was a problem hiding this comment.
I think this is fine as a default assumption. Nice solution
2281210 to
3b651aa
Compare
sovdeeth
approved these changes
Apr 13, 2026
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
As documented by @TheLimeGlass in issue #8534, Skript prefers EffDoIf(ExprDefaultValue) over ExprTernary in situations where do-if should have lower priority. This is because EffDoIf does not declare its priority as
PATTERN_MATCHES_EVERYTHINGdespite involving the regular expression<.+>in its pattern. The current implementation for calculating the implicit priority of a syntax does not take regular expressions into account, even though it could;PATTERN_MATCHES_EVERYTHINGis intended precisely for syntaxes that have these kinds of regular expressions.Solution
A general solution is given. This PR adjusts the implicit priority calculation to automatically apply a priority of
PATTERN_MATCHES_EVERYTHINGto syntaxes that use regular expressions (have an angle bracket in one or more of their patterns). An additional conditional case is added toestimatePriorityinSyntaxInfoImpl.Testing Completed
I verified that this change solves the issue documented in #8534, and does not break our tests (using
quickTest). I've also used skUnity Docs to identify all syntaxes that have a pattern that includes a regular expression, and did not immediately see any patterns that could reasonably break because of these changes. A tab-separated list of all syntaxes documented on skUnity containing<in their pattern (as retrieved from the skUnity Docs API) is given.1Supporting Information
All skUnity syntaxes can be retrieved using an API key from the URL
https://api.skunity.com/v1/API_KEY_HERE/docs/getAllSyntax. I used my own personal API key, which I found on the skUnity Dashboard.Completes: #8534
Related: Discussion on the SkriptLang Discord
AI assistance: For creating the JQ pattern that exported syntax patterns containing
<from the skUnitygetAllSyntaxJSONFootnotes
regexful.csv on GitHub Gist ↩