Skip to content

preInit Follow Up + SectionExpression#isSectionOnly #7929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: dev/feature
Choose a base branch
from

Conversation

Absolutionism
Copy link
Contributor

Problem

  1. The new #preInit method that was added, was only taken advantage of in SimpleExpression allowing default implementation of SyntaxRuntimeErrorProducer and was not done for Effect, Condition and Section.

  2. There was no API to distinguish if a SectionExpression could only be used as a Section.

Solution

  1. Overrides #preInit in Effect, Condition, and Section setting the Node and implementing SyntaxRuntimeErrorProducer allowing all elements by default to have access to it. Including sub types that elements extend such as EffectSection and SectionExpression

  2. Adds a #isSectionOnly in SectionExpression allowing to check if it can only be used as a Section.

    • With this, adds a default error in ExpressionSection where if the SectionNode is null and SectionExpression#isSectionOnly returns true, prints an error and returns false in ExpressionSection#init.

Testing Completed

N/A

Supporting Information

N/A


Completes: none
Related: none

@Absolutionism Absolutionism requested review from a team as code owners June 7, 2025 01:45
@Absolutionism Absolutionism requested review from UnderscoreTud and TheMug06 and removed request for a team June 7, 2025 01:45
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Jun 7, 2025
@APickledWalrus APickledWalrus self-requested a review June 7, 2025 01:48
@skriptlang-automation skriptlang-automation bot removed the needs reviews A PR that needs additional reviews label Jun 7, 2025
@Absolutionism Absolutionism requested a review from sovdeeth June 7, 2025 23:52
@sovdeeth sovdeeth moved this to In Review in 2.12 Release Jun 8, 2025
@github-project-automation github-project-automation bot moved this from In Review to Awaiting Merge in 2.12 Release Jun 8, 2025
@sovdeeth sovdeeth added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label Jun 8, 2025
@Efnilite Efnilite added the feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. label Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something. feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version.
Projects
Status: Awaiting Merge
Development

Successfully merging this pull request may close these issues.

3 participants