Skip to content
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

Change comment parsing #6583

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

Conversation

sovdeeth
Copy link
Member

@sovdeeth sovdeeth commented Apr 18, 2024

Description

This PR allows the usage of un-escaped #s in quoted strings:

  1. You do not have to double # in strings anymore. All # in text will appear as-is in the parsed code. This means the following is valid: set {_a} to "#1: <#abcdef>test" # test

I also allowed both <##abcdef> and <#abcdef> to be valid hex colours to minimize breaking changes for users.

This was also a good chance to update all the tests to remove the # 1, # 2, etc now that the tests include line numbers.

NOTE: strings that are not quoted, like the description entry in command structure, or the command pattern itself, still require escaped strings. Only explicitly quoted strings will not need doubled #s.


Target Minecraft Versions: any
Requirements: none
Related Issues: #5181

@sovdeeth sovdeeth added enhancement Feature request, an issue about something that could be improved, or a PR improving something. up for debate When the decision is yet to be debated on the issue in question breaking changes Pull or feature requests that contain breaking changes (API, syntax, etc.) 2.9 Targeting a 2.9.X version release labels Apr 18, 2024
Copy link
Member

@Moderocky Moderocky left a comment

Choose a reason for hiding this comment

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

Do you think it'd be appropriate to also have a regression test for the related issues? I think it's covered anyway but more tests make me a happy bunny.

src/test/skript/tests/misc/comments.sk Outdated Show resolved Hide resolved
Copy link
Member

@Moderocky Moderocky left a comment

Choose a reason for hiding this comment

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

Fantastic tests, a real 10/10.

Copy link
Member

@AyhamAl-Ali AyhamAl-Ali left a comment

Choose a reason for hiding this comment

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

Wonderful ⚡

src/main/java/ch/njol/skript/config/Node.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/config/Node.java Outdated Show resolved Hide resolved
@sovdeeth

This comment was marked as outdated.

@sovdeeth sovdeeth added the needs testing Needs testing to determine current status or issue validity, or for WIP feature pulls. label Apr 19, 2024
Copy link
Member

@APickledWalrus APickledWalrus left a comment

Choose a reason for hiding this comment

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

Just marking this so that I remember to review it soon

@AyhamAl-Ali AyhamAl-Ali added the require docs update A PR that requires Skript docs to be updated to reflect the related changes. label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.9 Targeting a 2.9.X version release breaking changes Pull or feature requests that contain breaking changes (API, syntax, etc.) enhancement Feature request, an issue about something that could be improved, or a PR improving something. needs testing Needs testing to determine current status or issue validity, or for WIP feature pulls. require docs update A PR that requires Skript docs to be updated to reflect the related changes. up for debate When the decision is yet to be debated on the issue in question
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants