You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@age.apache.org by "jrgemignani (via GitHub)" <gi...@apache.org> on 2025/12/10 01:20:29 UTC

[PR] update grammar file for maintainability [age]

jrgemignani opened a new pull request, #2270:
URL: https://github.com/apache/age/pull/2270

   Consolidated duplicate code, added helper functions, and reviewed the grammar file for issues.
   
   NOTE: I used an AI tool to review and cleanup the grammar file. I
              have reviewed all of the work it did.
   
   Improvements:
   
   1. Added KEYWORD_STRDUP macro to eliminate hardcoded string lengths
   2. Consolidated EXPLAIN statement handling into make_explain_stmt helper
   3. Extracted WITH clause validation into validate_return_item_aliases helper
   4. Created make_default_return_node helper for subquery return-less logic
   5. Added grammar_improvements regression test
   
   Benefits:
   
   - Reduced code duplication by ~150 lines
   - Improved maintainability with helper functions
   - Eliminated manual string length calculations (error-prone)
   
   All 29 existing regression tests pass
   
   modified:   src/backend/parser/cypher_gram.y


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] update grammar file for maintainability [age]

Posted by "MuhammadTahaNaveed (via GitHub)" <gi...@apache.org>.
MuhammadTahaNaveed merged PR #2270:
URL: https://github.com/apache/age/pull/2270


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] update grammar file for maintainability [age]

Posted by "MuhammadTahaNaveed (via GitHub)" <gi...@apache.org>.
MuhammadTahaNaveed commented on PR #2270:
URL: https://github.com/apache/age/pull/2270#issuecomment-3642432913

   @jrgemignani I don't think there's a need for adding a separate test file just for these tests. These tests are already in abundance in other test files. Maybe in future we should have a separate one for grammar, but it should be a comprehensive test suite and should cover all constructs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] update grammar file for maintainability [age]

Posted by "jrgemignani (via GitHub)" <gi...@apache.org>.
jrgemignani commented on PR #2270:
URL: https://github.com/apache/age/pull/2270#issuecomment-3642473658

   > @jrgemignani I don't think there's a need for adding a separate test file just for these tests. These tests are already in abundance in other test files. Maybe in future we should have a separate one for grammar, but it should be a comprehensive test suite and should cover all constructs.
   
   removed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org