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

Add lexer for the Clean language #1305

Merged
merged 2 commits into from
Aug 22, 2019
Merged

Add lexer for the Clean language #1305

merged 2 commits into from
Aug 22, 2019

Conversation

camilstaps
Copy link
Contributor

Some notes:

  • Clean is a functional programming language similar to Haskell. Because Clean uses different comment markers, Haskell lexers will immediately fail on almost any Clean code.
  • Some regexes in here were stolen from https://gitlab.science.ru.nl/cloogle/clean-highlighter/blob/master/clean.js which I maintain. It attempts to recognise many more fine distinctions but is because of that unfortunately more buggy. In here I tried to be more minimal.
  • The code { ... } construct allows one to use inline ABC code (comparable to inline assembly code in C).

Any suggestions would be welcome! Thanks for taking the time to review 🙇‍♂️

@pyrmont pyrmont added the needs-review The PR needs to be reviewed label Aug 17, 2019
@pyrmont
Copy link
Contributor

pyrmont commented Aug 17, 2019

@camilstaps Thanks for the PR! I'll try to look at this over the next couple of days :)

@camilstaps
Copy link
Contributor Author

That's great, @pyrmont! You have done an amazing job with catching up with the backlog so far, as far as I can see 👍

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.

Please let me know if any of the comments are unclear! (Or if I've made a mistake!)

lib/rouge/lexers/clean.rb Show resolved Hide resolved
lib/rouge/lexers/clean.rb Show resolved Hide resolved
lib/rouge/lexers/clean.rb Show resolved Hide resolved
lib/rouge/lexers/clean.rb Show resolved Hide resolved
lib/rouge/lexers/clean.rb Show resolved Hide resolved
lib/rouge/lexers/clean.rb Show resolved Hide resolved
lib/rouge/lexers/clean.rb Show resolved Hide resolved
lib/rouge/lexers/clean.rb Outdated Show resolved Hide resolved
lib/rouge/lexers/clean.rb Show resolved Hide resolved
spec/visual/samples/clean 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 Aug 19, 2019
@camilstaps
Copy link
Contributor Author

Thanks @pyrmont. I believe I addressed all your questions and added examples (for the latter I did not reply to your comments). The sample has also been shortened significantly. I'm only unsure what to do with the . of ABC keywords.

@camilstaps
Copy link
Contributor Author

To be clear, Clean's ABC language is different from the musical notation language for which a lexer was proposed in #1092.

@pyrmont
Copy link
Contributor

pyrmont commented Aug 19, 2019

@camilstaps Thanks for replying so quickly! Will try to get back to you with similar speed! :)

@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 Aug 19, 2019
@pyrmont
Copy link
Contributor

pyrmont commented Aug 19, 2019

@camilstaps I think there are only two comments outstanding at this stage. Let me know if anything is unclear!

@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 Aug 19, 2019
@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 Aug 21, 2019
@pyrmont pyrmont merged commit 6ad8346 into rouge-ruby:master Aug 22, 2019
@pyrmont pyrmont removed the needs-review The PR needs to be reviewed label Aug 22, 2019
@pyrmont
Copy link
Contributor

pyrmont commented Aug 22, 2019

Thanks for your submission, @camilstaps! Always good to have another language be part of Rouge :)

We're currently following a two-week cadence for minor releases and this code is scheduled to land in v3.10.0 on Tuesday 3 September 🎉

@camilstaps camilstaps deleted the add-clean-lexer branch August 22, 2019 09:24
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