Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 10, 2025

Adds documentation for the BNF support packages (apyds-bnf/atsds-bnf) which provide bidirectional conversion between DS's S-expression syntax and human-readable infix notation.

Changes

  • New section: Support Packages in docs navigation for extensibility
  • New file: docs/support-packages/bnf.md with:
    • Installation for Python and JavaScript/TypeScript
    • Parse/unparse usage examples
    • Syntax comparison table (Ds ↔ Dsp)
  • Updated: mkdocs.yml navigation structure

Example Usage

from apyds_bnf import parse, unparse

# Dsp → Ds
parse("a, b -> c")
# a
# b
# ----
# c

# Ds → Dsp  
unparse("a\nb\n----\nc")
# a, b -> c
Original prompt

This section details on the original issue you should resolve

<issue_title>需要在 docs/ 添加对support packages bnf 的介绍</issue_title>
<issue_description>添加一页就行(包括安装和使用), 毕竟挺简单的, 但是应该需要分一个section, 以后有新的support pacakge 也放进去.</issue_description>

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


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add introduction to support packages bnf in docs Add BNF support package documentation Dec 10, 2025
Copilot AI requested a review from hzhangxyz December 10, 2025 18:07
@hzhangxyz hzhangxyz marked this pull request as ready for review December 10, 2025 18:26
Copilot AI review requested due to automatic review settings December 10, 2025 18:26
@hzhangxyz hzhangxyz merged commit 1929a8b into main Dec 10, 2025
11 checks passed
Copy link
Contributor

Copilot AI left a 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 PR adds comprehensive documentation for the BNF support packages that provide bidirectional conversion between DS's S-expression syntax (Ds) and human-readable infix notation (Dsp). The documentation is placed in a new "Support Packages" section, establishing a structure for future extensibility as mentioned in the original issue.

Key Changes

  • Created a new "Support Packages" section in the documentation navigation to house support library documentation
  • Added detailed BNF package documentation including installation instructions for both Python and JavaScript/TypeScript
  • Provided usage examples and a comprehensive syntax comparison table showing the conversion between Ds and Dsp formats

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
mkdocs.yml Added "Support Packages" section to navigation with BNF sub-entry
docs/support-packages/bnf.md New documentation file covering installation, usage examples, syntax formats, and package information for apyds-bnf and atsds-bnf

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

- Functions: `f(a, b)`
- Subscripts: `a[i, j]`
- Binary operators: `(a + b)` (parenthesized)
- Unary operators: `(~ a)` (parenthesized)
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

The documentation for unary operators is inconsistent. The description states unary operators are (~ a) (parenthesized), but the syntax comparison table on line 116 shows ~ a -> b without parentheses. According to the test files, when parsing (Dsp → Ds), unary operators don't require parentheses (~ a -> b), but when unparsing (Ds → Dsp), the output includes parentheses ((~ a) -> b). Consider clarifying this by noting that parentheses are optional for input but included in output, or showing both forms in the table.

Copilot uses AI. Check for mistakes.
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.

需要在 docs/ 添加对support packages bnf 的介绍

2 participants