-
Notifications
You must be signed in to change notification settings - Fork 9
Translate quote-quote as an "empty" limit #41
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
base: main
Are you sure you want to change the base?
Translate quote-quote as an "empty" limit #41
Conversation
Summary of ChangesHello @AryaHassanli, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a minor yet significant enhancement to the system's parsing capabilities by allowing an empty string literal to be interpreted as an 'empty' limit. This modification broadens the acceptable input formats for defining empty constraints, making the system more adaptable to diverse data representations and improving its robustness when handling configuration or input values. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request adds support for "" as a syntax for an empty limit. The change in the grammar appears correct. However, I've noticed a lack of tests for EmptyLimit. I've added a comment suggesting the addition of test cases for all supported syntaxes of EmptyLimit to ensure correctness and prevent future regressions.
| } | ||
|
|
||
| EmptyLimit <- ("empty" / "[]") { | ||
| EmptyLimit <- ("empty" / "[]" / "\"\"") { |
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.
While this change correctly adds "" as a syntax for EmptyLimit, I've noticed that there are no existing tests for EmptyLimit in matter/constraint/constraint_test.go. It's important to add tests to cover this functionality, especially when modifying the grammar.
Please add test cases for all three variants of EmptyLimit (empty, [], and the new "") to constraintTests in matter/constraint/constraint_test.go. This will ensure the parser behaves as expected and prevent future regressions.
Here are some suggested test cases:
{
constraint: "empty",
dataType: &types.DataType{BaseType: types.BaseDataTypeList},
min: types.DataTypeExtreme{Type: types.DataTypeExtremeTypeEmptyList, Format: types.NumberFormatHex},
max: types.DataTypeExtreme{Type: types.DataTypeExtremeTypeEmptyList, Format: types.NumberFormatHex},
},
{
constraint: "[]",
asciiDoc: "empty",
dataType: &types.DataType{BaseType: types.BaseDataTypeList},
min: types.DataTypeExtreme{Type: types.DataTypeExtremeTypeEmptyList, Format: types.NumberFormatHex},
max: types.DataTypeExtreme{Type: types.DataTypeExtremeTypeEmptyList, Format: types.NumberFormatHex},
},
{
constraint: `""`,
asciiDoc: "empty",
dataType: &types.DataType{BaseType: types.BaseDataTypeList},
min: types.DataTypeExtreme{Type: types.DataTypeExtremeTypeEmptyList, Format: types.NumberFormatHex},
max: types.DataTypeExtreme{Type: types.DataTypeExtremeTypeEmptyList, Format: types.NumberFormatHex},
},You might need to adjust them, for example by adding zapMin and zapMax values if applicable.
This PR adds
""as a possible value for empty limit/default/fallbacks.Fixes: #23
parser.gois a generated file. The diff is huge probably due to the version change of pigeon. The functionality remained the same except for the intended fix (tested manually by generating v1.5 files).Output example:
