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

(swift) New string grammar #2902

Merged
merged 9 commits into from
Dec 5, 2020
Merged

(swift) New string grammar #2902

merged 9 commits into from
Dec 5, 2020

Conversation

svanimpe
Copy link
Contributor

@svanimpe svanimpe commented Dec 2, 2020

This is a rewrite of the grammar for strings in Swift. I’ve implemented the official grammar (https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#grammar_string-literal) and included support for raw strings with up to three hash signs.

I’m submitting this PR as a WIP to get some early feedback, as this is my first contribution. If the grammar looks good, I'll add a suite of unit tests and update the changelog/contributor list.

Fixes #2819 and replaces #2820.

src/languages/swift.js Outdated Show resolved Hide resolved
src/languages/swift.js Outdated Show resolved Hide resolved
src/languages/swift.js Outdated Show resolved Hide resolved
Copy link
Member

@joshgoebel joshgoebel left a comment

Choose a reason for hiding this comment

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

Awesome. Already looking much better than the first pass! :-)

@svanimpe
Copy link
Contributor Author

svanimpe commented Dec 2, 2020

@joshgoebel I've pushed a new version that incorporates your feedback.

src/languages/swift.js Outdated Show resolved Hide resolved
src/languages/swift.js Outdated Show resolved Hide resolved
@joshgoebel
Copy link
Member

If the grammar looks good, I'll add a suite of unit tests and update the changelog/contributor list.

I think this is looking pretty good, feel free to finish it up.

@svanimpe svanimpe changed the title [WIP] (swift) New string grammar (swift) New string grammar Dec 2, 2020
@svanimpe svanimpe requested a review from joshgoebel December 2, 2020 21:51
@svanimpe
Copy link
Contributor Author

svanimpe commented Dec 2, 2020

Ready for a final review!

CHANGES.md Show resolved Hide resolved
@svanimpe
Copy link
Contributor Author

svanimpe commented Dec 4, 2020

Is anything blocking this? I see "Changes requested" but no unresolved conversations.

@joshgoebel joshgoebel merged commit 2b833dd into highlightjs:master Dec 5, 2020
@joshgoebel
Copy link
Member

@svanimpe Nope. All good!

@svanimpe svanimpe deleted the swift-raw-strings branch December 16, 2020 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(Swift) Incorrect highlighting of raw strings
2 participants