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

Rust code highlighting fixes #452

Closed
wants to merge 3 commits into from

Conversation

HarryLovesCode
Copy link

Fixes incorrect highlighting of:

  • String escapes
  • Feature gates, attributes
  • Underscores in numbers

mixin :whitespace
rule /\b(?:#{Rust.keywords.join('|')})\b/, Keyword
mixin :has_literals


rule /#!*\[/ do
Copy link
Member

Choose a reason for hiding this comment

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

should shebangs have to be at the beginning (\A) of the file?

@jneen
Copy link
Member

jneen commented Jun 1, 2016

Hi @HarryLovesCode, could you add some code to spec/visual/samples/rust that exercises these fixes and make sure it looks right (by running bundle exec rackup and visiting localhost:9292/rust)

@jneen jneen added discussion-open bugfix-request A request for a bugfix to be developed. labels Jun 1, 2016
@HarryLovesCode
Copy link
Author

Tell me if this needs to be squashed or if there are any concerns you have.

}
}

println!("The program \"{}\" calculates the value {}", program, accumulator);
}
Copy link
Member

Choose a reason for hiding this comment

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

This file is far too long to be a demo now. It is not important to me that the demos compile correctly, just that they show off a little bit of the highlighting. Is there a smaller snippet you could provide here?

@jneen
Copy link
Member

jneen commented Aug 5, 2016

Hi @HarryLovesCode, I think you added your example to the wrong file - lib/rouge/demos/rust is a little taste of what highlighted rust code looks like. I want you to add an example to spec/visual/samples/rust, which stress-tests all the little features and corner cases.

@hugopeixoto
Copy link
Contributor

Most of the issues addressed by this PR have already been merged:

I opened two PRs with the missing features:

@pyrmont
Copy link
Contributor

pyrmont commented Sep 8, 2020

@HarryLovesCode I'm really sorry it took so long to get this all squared away but I've just merged in the two PRs @hugopeixoto opened for the outstanding issues and they'll be part of the next release of Rouge, v3.23.0. That's actually due to come out later today/early tomorrow (depending on your time zone). Given it's been four (!) years, I don't blame you if you've moved on but wanted to keep you in the loop just in case!

@hugopeixoto Thanks so much for both submitting the remaining PRs and doing the yeoman's work of actually tracking down the PRs where the changes had been subsequently added. Really appreciate it!

@pyrmont pyrmont closed this Sep 8, 2020
@pyrmont pyrmont removed bugfix-request A request for a bugfix to be developed. discussion-open labels Sep 8, 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.

4 participants