Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

APickledWalrus
Copy link
Member

Problem

#7879 changed syntax ordering so that it was no longer dependent on when the syntax was registered. However, most syntax is not using Priority yet, meaning more complex syntax (i.e. harder to parse) such as EffVisualEffect is being attempted early on in some cases (when it should instead be saved for last).

Solution

While these more complex syntaxes should have a higher priority, I have created a simple metric for determining the "complexity" of a syntax. Currently, the metric simply considers how many percent signs a pattern contains (they have not yet been compiled and i didn't think it was worth doing that). The idea is that percent signs = expressions and more expressions = more complex (harder to parse) which is generally true

Testing Completed

n/a

Supporting Information


Completes: none
Related: none

@APickledWalrus APickledWalrus requested a review from a team as a code owner July 23, 2025 20:53
@APickledWalrus APickledWalrus added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label Jul 23, 2025
@APickledWalrus APickledWalrus requested review from Efnilite and TheMug06 and removed request for a team July 23, 2025 20:53
@APickledWalrus APickledWalrus moved this to In Review in 2.12 Releases Jul 24, 2025
Copy link
Member

@sovdeeth sovdeeth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can go further with the complexity eval but this is a fine start.

@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Jul 25, 2025
@APickledWalrus APickledWalrus requested a review from sovdeeth July 25, 2025 19:09
@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 Jul 25, 2025
@APickledWalrus
Copy link
Member Author

We may also consider improving this in the future by storing compiled patterns on every SyntaxInfo and instead iteratoring over the pattern elements. That requires a more complex rework, so this should suffice for a patch.

@github-project-automation github-project-automation bot moved this from In Review to Awaiting Merge in 2.12 Releases Jul 30, 2025
@APickledWalrus APickledWalrus merged commit 98d5846 into SkriptLang:dev/patch Jul 30, 2025
5 of 6 checks passed
@github-project-automation github-project-automation bot moved this from Awaiting Merge to Done - Awaiting Release in 2.12 Releases Jul 30, 2025
@APickledWalrus APickledWalrus deleted the patch/better-syntax-ordering branch July 30, 2025 19:46
@skriptlang-automation skriptlang-automation bot added completed The issue has been fully resolved and the change will be in the next Skript update. and removed patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version. labels Jul 30, 2025
@sovdeeth sovdeeth moved this from Done - Awaiting Release to Done - Released in 2.12 Releases Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed The issue has been fully resolved and the change will be in the next Skript update. enhancement Feature request, an issue about something that could be improved, or a PR improving something.
Projects
Status: Done - Released
Development

Successfully merging this pull request may close these issues.

4 participants