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 Meson Lexer #1732

Merged
merged 8 commits into from
Jul 15, 2022
Merged

Add Meson Lexer #1732

merged 8 commits into from
Jul 15, 2022

Conversation

funatsufumiya
Copy link
Contributor

@funatsufumiya funatsufumiya commented Aug 16, 2021

This adds a lexer for Meson (https://mesonbuild.com/Syntax.html)

screenshot 2021-08-16 22 28 30

@tancnle tancnle added the needs-review The PR needs to be reviewed label Jan 26, 2022
@tancnle tancnle self-assigned this Jun 30, 2022
Copy link
Collaborator

@tancnle tancnle left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution @funatsufumiya ❤️ And welcome to Rouge. The PR looks good to be overall. I have left some suggestions for your consideration.

In addition, could you kindly:

  1. add some specs for this lexer, mostly around guessing (see Python spec for inspiration)
  2. rebase this branch off master and add an entry to the Languages.md

Please let me know what you think 🙏🏼

lib/rouge/lexers/meson.rb Outdated Show resolved Hide resolved
lib/rouge/lexers/meson.rb Outdated Show resolved Hide resolved
title "Meson"
desc "Meson's specification language"
tag 'meson'
filenames 'meson.build'
Copy link
Collaborator

Choose a reason for hiding this comment

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

suggestion: Do you think we could consider specifying a mimetype as well?

mimetypes 'text/x-meson'

rule %r/\@/, Str::Interpol, :pop!
end

class StringRegister < Array
Copy link
Collaborator

Choose a reason for hiding this comment

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

thought (non-blocking): Since this inner-class is shared with the one in the Python lexer, I would suggest extracting this to a common place to reduce duplication. No action is required in this PR. I will take point on the follow-up PR.

@tancnle tancnle added the author-action The PR has been reviewed but action by the author is needed label Jul 10, 2022
@tancnle tancnle removed their assignment Jul 10, 2022
funatsufumiya and others added 2 commits July 14, 2022 14:16
Co-authored-by: Tan Le <tan.le@hey.com>
Co-authored-by: Tan Le <tan.le@hey.com>
@funatsufumiya
Copy link
Contributor Author

@tancnle
Thank you. All suggestions might be cool, but I don't have enough time to achieve them quickly. I'll look through little by little.

@tancnle
Copy link
Collaborator

tancnle commented Jul 15, 2022

@tancnle Thank you. All suggestions might be cool, but I don't have enough time to achieve them quickly. I'll look through little by little.

No worries @funatsufumiya. In the spirit of iteration, let's merge this change for now 🚀 I can have a look at implementing them or you might beat me into it :)

@tancnle tancnle merged commit 8195f23 into rouge-ruby:master Jul 15, 2022
@tancnle tancnle mentioned this pull request Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author-action The PR has been reviewed but action by the author is needed needs-review The PR needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants