Skip to content

Update BNF documentation to reflect trailing newline in DS format - #120

Merged
hzhangxyz merged 2 commits into
mainfrom
copilot/update-bnf-documentation
Dec 16, 2025
Merged

Update BNF documentation to reflect trailing newline in DS format#120
hzhangxyz merged 2 commits into
mainfrom
copilot/update-bnf-documentation

Conversation

Copilot AI commented Dec 16, 2025

Copy link
Copy Markdown
Contributor

The DS format output from parse() includes a trailing newline character, but the documentation examples showed it without one.

Changes

  • Code examples: Updated ds_input strings in Python and JavaScript examples to include trailing \n
  • Syntax comparison tables: Added trailing \n to all DS format examples in both bnf/README.md and docs/support-packages/bnf.md

Example

Before:

ds_input = "a\nb\n----\nc"

After:

ds_input = "a\nb\n----\nc\n"

This matches the actual implementation behavior where both axioms and multi-premise rules append a trailing newline.

Original prompt

This section details on the original issue you should resolve

<issue_title>bnf相关的文档需要更新</issue_title>
<issue_description>ds格式下, 最后多了一个 '\n' , 需要在 bnf/README.md 和 docs/support-packages/bnf.md 下更新.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Update BNF documentation to remove trailing newline Update BNF documentation to reflect trailing newline in DS format Dec 16, 2025
Copilot AI requested a review from hzhangxyz December 16, 2025 10:12
@hzhangxyz
hzhangxyz marked this pull request as ready for review December 16, 2025 10:14
Copilot AI review requested due to automatic review settings December 16, 2025 10:14
@hzhangxyz
hzhangxyz merged commit 926d0eb into main Dec 16, 2025
112 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates documentation to accurately reflect that the DS format output from the parse() function includes a trailing newline character. The changes correct examples and syntax comparison tables in both the main BNF package README and the support packages documentation to match the actual implementation behavior.

Key Changes

  • Updated all DS format string examples to include trailing \n character
  • Modified syntax comparison tables to show the trailing newline in all DS format entries
  • Changes applied consistently across both Python and JavaScript code examples

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
bnf/README.md Updated Python/JavaScript examples and syntax comparison table to include trailing newlines in DS format strings
docs/support-packages/bnf.md Updated Python/JavaScript examples and syntax comparison table to include trailing newlines in DS format strings

The changes in this PR are accurate and complete. After reviewing the implementation in bnf/apyds_bnf/__init__.py and the test suite in bnf/tests/test_parse_unparse.py, I can confirm that:

  1. The ParseVisitor.visitRule() method explicitly adds trailing newlines for both axioms and multi-premise rules
  2. All test cases use DS format strings with trailing newlines
  3. The documentation updates correctly reflect this behavior across all examples and tables
  4. The changes are consistently applied in both documentation files

The PR successfully addresses the issue described in the original Chinese issue report, ensuring that the documentation matches the actual implementation behavior.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

bnf相关的文档需要更新

3 participants