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

Replace peg crate with manually implemented parser #181

Merged
merged 7 commits into from
Feb 8, 2022

Conversation

ilslv
Copy link
Contributor

@ilslv ilslv commented Jan 19, 2022

In 0.6 release of peg build.rs parser generation support was removed, so to keep our dependencies up to date, we've decided to re-implement parser. Design is heavily inspired by nom crate.

This PR also fixes some inconsistencies with original format_string syntax and adds support for non-ascii identifiers. To make this possible I've added 1 dependency: unicode-xid, but actually syn crate already depends on it.

Also parser supports non-integer parameters, because in follow-up PR I'm planning to add support for interpolated strings introduces in 1.58 release while preserving MSRV.

@ilslv ilslv marked this pull request as ready for review January 19, 2022 08:16
Copy link
Collaborator

@tyranron tyranron left a comment

Choose a reason for hiding this comment

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

@ilslv LGTM, thanks! 🍻

@JelteF I'd like you to look at this as well, whether you're OK with these changes.

@tyranron tyranron requested a review from JelteF January 24, 2022 14:25
@tyranron
Copy link
Collaborator

tyranron commented Feb 3, 2022

ping @JelteF

Copy link
Owner

@JelteF JelteF left a comment

Choose a reason for hiding this comment

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

I haven't looked in detail at the new parser code, but it looks much more understandable than the previous auto generated one. Given none of our display tests fail, I think it's fine to merge.

@JelteF JelteF merged commit 73386d6 into JelteF:master Feb 8, 2022
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.

3 participants