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

lexer: TOML: Support more integer and floating formats #1832

Merged
merged 12 commits into from Jul 2, 2022

Conversation

ToruNiina
Copy link
Contributor

Hi,
I wrote this patch to fix #1831 .

I added hex, bin, oct integers and special floating point numbers to the rule. And I modified the existing definition of integer and floating point numbers to allow underscores.
I also added some examples of those new features to spec/visual/samples/toml.

Then I visually checked that the examples of the features I mentioned in the issue.

rouge-toml-lexer

In the screenshot I included some invalid examples to check if those are highlighted as an error, but I didn't include them in the spec/visual/sample to avoid confusion.
If those invalid examples are beneficial, I will add them.

Please check it when you have time.
Thanks!

@tancnle tancnle self-assigned this Jun 24, 2022
@tancnle tancnle added the needs-review The PR needs to be reviewed label Jun 24, 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 @ToruNiina ❤️ The PR looks good overall. I have added some suggestions for your consideration. Please let me know what you think 🙏🏼 .

lib/rouge/lexers/toml.rb Outdated Show resolved Hide resolved
lib/rouge/lexers/toml.rb Outdated Show resolved Hide resolved
lib/rouge/lexers/toml.rb Outdated Show resolved Hide resolved
lib/rouge/lexers/toml.rb Outdated Show resolved Hide resolved
lib/rouge/lexers/toml.rb Outdated Show resolved Hide resolved
lib/rouge/lexers/toml.rb Outdated Show resolved Hide resolved
@tancnle tancnle added the author-action The PR has been reviewed but action by the author is needed label Jul 1, 2022
ToruNiina and others added 6 commits July 1, 2022 20:46
Co-authored-by: Tan Le <tan.le@hey.com>
Co-authored-by: Tan Le <tan.le@hey.com>
Co-authored-by: Tan Le <tan.le@hey.com>
Co-authored-by: Tan Le <tan.le@hey.com>
Co-authored-by: Tan Le <tan.le@hey.com>
Co-authored-by: Tan Le <tan.le@hey.com>
@ToruNiina
Copy link
Contributor Author

Thank you for your time and effort on the request and many helpful suggestions.

I totally agree with the suggestions. I applied all the changes.
Could you check it again? Thanks!

@tancnle
Copy link
Collaborator

tancnle commented Jul 2, 2022

Awesome work @ToruNiina 👍🏼 Let's ship it 🚀

@tancnle tancnle merged commit 1facc23 into rouge-ruby:master Jul 2, 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.

lexer: TOML: Support more integer and floating formats
2 participants