Skip to content

Avoid 'can't use variables here' errors by using regex match for ExprSecPotionEffect#8405

Merged
sovdeeth merged 2 commits intoSkriptLang:dev/patchfrom
sovdeeth:patch/potion-expr-bad-pattern
Jan 29, 2026
Merged

Avoid 'can't use variables here' errors by using regex match for ExprSecPotionEffect#8405
sovdeeth merged 2 commits intoSkriptLang:dev/patchfrom
sovdeeth:patch/potion-expr-bad-pattern

Conversation

@sovdeeth
Copy link
Copy Markdown
Member

Problem

ExprSecPotionEffect has no keywords or literal text, meaning it is attempted against nearly everything that hasn't successfully parsed. This has lead to many cases where errors would say "cannot use variable here" despite not being relevant, because the var was being parsed for ExprSecPotionEffect and faililng. This shows that we need a better error handling method for parsing, but in lieu of attempting a large project like that, I chose to change the pattern instead.

Solution

Uses a regex match instead of a literal number type pattern to avoid spurious cannot use variables here errors.

Testing Completed

Tested on own repository of scripts (hundred or so). No change to parse times and fixed the wrong errors.

Supporting Information


Completes: #8364
Related: none
AI assistance: none

@sovdeeth sovdeeth requested a review from a team as a code owner January 25, 2026 02:52
@sovdeeth sovdeeth added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Jan 25, 2026
@sovdeeth sovdeeth requested review from Absolutionism and erenkarakal and removed request for a team January 25, 2026 02:52
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Jan 25, 2026
@sovdeeth sovdeeth moved this to In Review in 2.14 Releases Jan 25, 2026
@sovdeeth sovdeeth linked an issue Jan 25, 2026 that may be closed by this pull request
1 task
@github-project-automation github-project-automation bot moved this from In Review to Awaiting Merge in 2.14 Releases Jan 25, 2026
@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 Jan 25, 2026
@sovdeeth sovdeeth merged commit daa773f into SkriptLang:dev/patch Jan 29, 2026
9 checks passed
@github-project-automation github-project-automation bot moved this from Awaiting Merge to Done - Awaiting Release in 2.14 Releases Jan 29, 2026
@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 Jan 29, 2026
@sovdeeth sovdeeth moved this from Done - Awaiting Release to Done - Released in 2.14 Releases Feb 7, 2026
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. completed The issue has been fully resolved and the change will be in the next Skript update.

Projects

Status: Done - Released

Development

Successfully merging this pull request may close these issues.

Avoid "Variables cannot be used here" error message for unrelated issues.

4 participants