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

Updates for Swift 5.1 #1332

Merged
merged 5 commits into from Jan 5, 2020
Merged

Updates for Swift 5.1 #1332

merged 5 commits into from Jan 5, 2020

Conversation

AlanQuatermain
Copy link
Contributor

This adds three things:

  • Support for the some keyword from Swift 5.1.
  • Coloring for KeyPath syntax such as \.TypeName.propertyName.
  • A few more items in the Swift demo document, to provide better coverage of new features.

The demo document shows that in case .value?: the .value isn't actually captured as a variable name, unlike the plain case .value: variant. It looks like the rule on line 120 should capture this, but my regex-fu is somewhat rusty and I've not actually delved into the rouge API enough to get a deep understanding of exactly what I'm seeing here. Any suggestions to solve that particular issue would be greatly appreciated.

@pyrmont pyrmont self-assigned this Sep 16, 2019
@pyrmont pyrmont added the needs-review The PR needs to be reviewed label Sep 16, 2019
Copy link
Contributor

@pyrmont pyrmont left a comment

Choose a reason for hiding this comment

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

The reason the values in the case statements are matching inconsistently looks like it's being caused by .c matching as a function. I'm having a look through this lexer and it could use some tightening up. I think I'll open a separate issue for that and we can work on both things in parallel.

lib/rouge/lexers/swift.rb Outdated Show resolved Hide resolved
@pyrmont pyrmont added author-action The PR has been reviewed but action by the author is needed and removed needs-review The PR needs to be reviewed labels Sep 17, 2019
@pyrmont pyrmont merged commit 3ed2f30 into rouge-ruby:master Jan 5, 2020
@pyrmont pyrmont removed the author-action The PR has been reviewed but action by the author is needed label Jan 5, 2020
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.

None yet

3 participants