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

Merged

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 sovdeeth requested a review from AyhamAl-Ali April 19, 2024 10:23
@sovdeeth

This comment was marked as outdated.

@sovdeeth sovdeeth force-pushed the enhancement/comment-parsing branch from b4f48cc to c7fe4be Compare April 19, 2024 12:15
@sovdeeth sovdeeth requested a review from Moderocky April 19, 2024 12:17
@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
@sovdeeth
Copy link
Member Author

Just marking this so that I remember to review it soon

one day my prince will come

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.

nice work

src/main/java/ch/njol/skript/config/Node.java Outdated Show resolved Hide resolved
@sovdeeth sovdeeth added feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. and removed up for debate When the decision is yet to be debated on the issue in question labels Jun 30, 2024
@sovdeeth sovdeeth merged commit e8c8b5f into SkriptLang:dev/feature Jul 1, 2024
5 checks passed
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. feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants