-
Notifications
You must be signed in to change notification settings - Fork 740
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
Add Meson Lexer #1732
Conversation
There was a problem hiding this 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:
- add some specs for this lexer, mostly around guessing (see Python spec for inspiration)
- 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
title "Meson" | ||
desc "Meson's specification language" | ||
tag 'meson' | ||
filenames 'meson.build' |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
Co-authored-by: Tan Le <[email protected]>
Co-authored-by: Tan Le <[email protected]>
@tancnle |
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 :) |
This adds a lexer for Meson (https://mesonbuild.com/Syntax.html)