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

Make empty strings section invalid #192

Merged
merged 1 commit into from
Dec 2, 2021

Conversation

msm-code
Copy link
Contributor

@msm-code msm-code commented Dec 1, 2021

Another small PR from me. This time I've tackled #141.

After merging this, empty strings: section won't be allowed. I achieve this by adding a new rule for strings_body_nonempty that cannot be empty, and using it instead of strings_body in the main derivation.

This is not related to any issue with mquery, but saw that issue on the issue list and figured I can try to solve it. I realise it's very low priority, but probably also won't hurt.

fixes: #141

@TadeasKucera TadeasKucera self-requested a review December 2, 2021 13:31
Copy link
Contributor

@TadeasKucera TadeasKucera 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 this PR, it does precisely what your description says. By adding one non-terminal symbol to the grammar you postpone the possibility to generate empty word from the non-terminal strings_body_nonempty. It is correct and I will merge it. I will also make some cosmetics changes immediately after merge, because we are used to put the semicolon on a new line in the grammar definition. Thank you very much!

@TadeasKucera TadeasKucera merged commit 217a60f into avast:master Dec 2, 2021
@msm-code
Copy link
Contributor Author

msm-code commented Dec 2, 2021

Glad i could help!
Thanks for mentioning the semicolon formatting - I'll keep that in mind in the future.

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.

Empty strings part of the rule is parsed without error
2 participants