-
Notifications
You must be signed in to change notification settings - Fork 0
Add BNF package documentation and support packages section #83
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
Conversation
Co-authored-by: hzhangxyz <[email protected]>
Co-authored-by: hzhangxyz <[email protected]>
hzhangxyz
left a comment
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.
- /README.md 下面 support packages 写一个行就行了, 给个作用和链接就行.
- API Reference 这个section可以删除, 前面的足够了
- Examples这个section也可以删除, 前面的足够了
- Testing 这个section也要删除, 完全是多余的
- Development 这个section也删除
…n and remove API Reference, Examples, Testing, and Development sections Co-authored-by: hzhangxyz <[email protected]>
All requested changes completed in 7e1ef15:
The BNF README is now more concise (196 lines vs 375), keeping only essential sections: Features, Installation, Quick Start, Syntax Formats, Building from Source, and Grammar Files. |
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.
Pull request overview
This pull request adds comprehensive documentation for the BNF conversion library, making it discoverable and usable as a standalone support package for the DS deductive system. The documentation enables users to understand and use the bidirectional syntax conversion between Ds (S-expression) and Dsp (human-readable) formats.
Key changes:
- Created detailed documentation for the
/bnfpackage with installation, usage examples, and syntax reference - Added "Support Packages" section to main README linking to the BNF conversion library packages
- Provided validated examples matching the test suite for both Python and JavaScript implementations
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| bnf/README.md | Comprehensive package documentation including installation instructions, quick start examples, syntax comparison table, build instructions, and links to PyPI/npm packages |
| README.md | Added "Support Packages" section listing the BNF conversion library with links to apyds-bnf (PyPI) and atsds-bnf (npm) packages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| | Binary operator | `(a + b) -> c` | `(binary + a b)\n--------------\nc` | | ||
| | Unary operator (parse input) | `~ a -> b` | `(unary ~ a)\n-----------\nb` | | ||
| | Unary operator (unparse output) | `(~ a) -> b` | `(unary ~ a)\n-----------\nb` | | ||
| | Complex expression | `((a + b) * c), d[i] -> f(g, h)` | `(binary * (binary + a b) c)\n(subscript d i)\n---------------------------\n(function f g h)` | |
Copilot
AI
Dec 9, 2025
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.
The Dsp format for the complex expression in the parse input should be (a + b) * c, d[i] -> f(g, h) (with single parentheses around a + b), not ((a + b) * c), d[i] -> f(g, h) (with double parentheses). The double parentheses are only added during unparsing for operator precedence. The current row incorrectly shows the unparsed output format for both input and output.
This should be split into two rows or clarified:
- Parse input:
(a + b) * c, d[i] -> f(g, h) - Unparse output:
((a + b) * c), d[i] -> f(g, h)
Reference: tests/test_parse_unparse.py lines 62 and 128.
| | Complex expression | `((a + b) * c), d[i] -> f(g, h)` | `(binary * (binary + a b) c)\n(subscript d i)\n---------------------------\n(function f g h)` | | |
| | Complex expression (parse input) | `(a + b) * c, d[i] -> f(g, h)` | `(binary * (binary + a b) c)\n(subscript d i)\n---------------------------\n(function f g h)` | | |
| | Complex expression (unparse output) | `((a + b) * c), d[i] -> f(g, h)` | `(binary * (binary + a b) c)\n(subscript d i)\n---------------------------\n(function f g h)` | |
The BNF conversion library (
/bnf) lacked proper documentation. Users couldn't discover or understand how to use the bidirectional syntax conversion between Ds (S-expression) and Dsp (human-readable) formats.Changes
/bnf/README.md: Created concise documentation (196 lines) following main README structureapyds-bnf(Python) andatsds-bnf(JavaScript)parse()andunparse()functions/README.md: Added "Support Packages" section/bnfdirectory for detailsExample
All examples validated against test suite (
/bnf/tests/test_parse_unparse.{py,mjs}).Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.