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

Sort KEYWORDS for consistent output ordering #44

Merged
merged 3 commits into from
Sep 29, 2021

Conversation

edemaine
Copy link
Contributor

Fixes #40 by adding sorted(...) as suggested previously.

I could use some guidance for writing tests.

@MatthieuDartiailh
Copy link
Collaborator

I am not sure either how to best test this feature. And actually currently no test validate the content of the KEYWORDS and SOFT_KEYWORDS attributes. So you could add a test under test_pegen.py generating a parser from a small grammar containing both hard and soft keywords and testing that the output is as expected. The other tests there should illustrate how to easily generate the parser class. Let me know if you need further guidance.

@edemaine
Copy link
Contributor Author

Thanks for the guidance! I've added a test that seems to do the job.

Copy link
Member

@lysnikolaou lysnikolaou left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @edemaine for the PR!

@pablogsal pablogsal merged commit 6178ec6 into we-like-parsers:main Sep 29, 2021
@pablogsal
Copy link
Contributor

Thanks, @edemaine! 🎉

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.

Consistent keyword ordering
4 participants