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

Implement an Objective-C++ lexer #1378

Merged
merged 3 commits into from Jan 8, 2020
Merged

Conversation

saagarjha
Copy link
Contributor

I tried my hand at factoring out the common Objective-C stuff into its own module, but I don't really know Ruby so the result is just me mashing scoping operators from other languages until it stopped giving me errors. Any suggestions or comments about this approach? I am fairly sure the Objective-C++ breaks on certain "mixed" constructs so I'll look into that next. Are there testcases I should write along with this?

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

pyrmont commented Dec 17, 2019

@saagarjha Development of Rouge should involve running the automated test suite (run rake from the command line) and checking that the relevant visual sample (in this case spec/lexers/samples/objective_cpp) is looking like it should (run rackup from the command line and go to localhost:9292).

I've added a demo file and a visual sample that are just copies of the Objective-C demo and sample. These should be adjusted to show Objective-C++ syntax.

It perhaps goes without saying but you should also check the Objective-C visual sample to make sure it's behaving as it was before the change.

Hope that helps!

@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 Dec 17, 2019
@saagarjha saagarjha marked this pull request as ready for review December 18, 2019 21:28
@pyrmont pyrmont added needs-review The PR needs to be reviewed and removed author-action The PR has been reviewed but action by the author is needed labels Jan 4, 2020
@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 Jan 5, 2020
In addition, factor out the common Objective-C bits into a shared module
This makes the methods available to class directly, so we don't have to
add them manually via reflection.

tag 'objective_cpp'
title "Objective-C++"
desc 'an extension of C++ uncommonly used to write Apple software'
Copy link
Contributor

Choose a reason for hiding this comment

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

I see what you did here 🥇

Copy link
Contributor Author

Choose a reason for hiding this comment

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

;)

@pyrmont pyrmont merged commit 7d9f158 into rouge-ruby:master Jan 8, 2020
@pyrmont pyrmont removed the author-action The PR has been reviewed but action by the author is needed label Jan 8, 2020
@pyrmont
Copy link
Contributor

pyrmont commented Jan 8, 2020

@saagarjha Thanks for your work on this. I've merged it into master. We release new versions of Rouge on a monthly schedule so this will be included in version 3.15.0 on Tuesday 14 January 🎉

@saagarjha
Copy link
Contributor Author

Thanks, I look forwards to being able to use this!

pyrmont pushed a commit that referenced this pull request Jan 25, 2020
Certain objects that were extracted from the Objective-C lexer in #1378
needed to be prefaced with a `base` variable. This included the token
classes. This was not done for `Error`. This commit fixes that mistake.
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

2 participants