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

Fix Prolog comment character #830

Merged
merged 3 commits into from Jun 18, 2019
Merged

Fix Prolog comment character #830

merged 3 commits into from Jun 18, 2019

Conversation

dariusf
Copy link
Contributor

@dariusf dariusf commented Dec 2, 2017

A number of mature Prolog implementations (SICStus, GNU, SWI) use % as the line comment character. GitHub also highlights it that way.

% percent
# hash

@gfx
Copy link
Member

gfx commented Dec 21, 2017

Sounds good. Thanks for your contributions.

@gfx gfx added the bugfix-request A request for a bugfix to be developed. label Dec 21, 2017
@beardhatcode
Copy link

beardhatcode commented Mar 23, 2018

Is there a reason why this is not yet merged?
Change is correct and works for me.

@dblessing
Copy link
Collaborator

Whoops. I didn't see this before I merged #898. That PR added % but did not remove #. @beardhatcode if you want you can rebase your PR and remove the now unnecessary # rule. The other PR author left it as they weren't sure if it was necessary or not. If you know it's not necessary then I'm happy to merge a PR for that.

@dariusf
Copy link
Contributor Author

dariusf commented Aug 12, 2018

Not changing how #! lines are highlighted seemed like a good idea, so I made the regex more specific instead of removing it.

lib/rouge/lexers/prolog.rb Outdated Show resolved Hide resolved
@pyrmont
Copy link
Contributor

pyrmont commented May 18, 2019

Thanks @jneen :)

@dariusf Using the C lexer as an example, this code works for me:

start { push :bol }

state :bol do
  rule /#.*/, Comment::Single
  rule(//) { pop! }
end

I then removed the rule /#.*/, Comment::Single line from the :basic state and it's working so far.

@dariusf
Copy link
Contributor Author

dariusf commented May 19, 2019

Made the suggested changes. Thanks, everyone.

@pyrmont pyrmont dismissed their stale review June 18, 2019 03:38

No longer required.

@pyrmont pyrmont merged commit 88de367 into rouge-ruby:master Jun 18, 2019
@pyrmont
Copy link
Contributor

pyrmont commented Jun 18, 2019

Sorry for the delay, @dariusf. I missed your fix. It took a while but thanks for helping to improve Rouge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix-request A request for a bugfix to be developed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants