Skip to content

Change BNF arrow notation from -> to => - #122

Merged
hzhangxyz merged 2 commits into
mainfrom
copilot/fix-bnf-language-symbols
Dec 20, 2025
Merged

Change BNF arrow notation from -> to =>#122
hzhangxyz merged 2 commits into
mainfrom
copilot/fix-bnf-language-symbols

Conversation

Copilot AI commented Dec 20, 2025

Copy link
Copy Markdown
Contributor

The BNF language used -> for rule arrows, which should be => to match standard BNF notation conventions.

Changes

Grammar

  • bnf/Dsp.g4: Updated rule syntax from '->' to '=>'

Implementation

  • bnf/apyds_bnf/__init__.py: Modified UnparseVisitor to generate =>
  • bnf/atsds_bnf/index.mjs: Modified UnparseVisitor to generate =>

Documentation

  • bnf/README.md: Updated all syntax examples
  • docs/support-packages/bnf.md: Updated all syntax examples

Tests

  • bnf/tests/test_parse_unparse.py: Updated test expectations
  • bnf/tests/test_parse_unparse.mjs: Updated test expectations

Example

Before:

premise1, premise2 -> conclusion

After:

premise1, premise2 => conclusion

The parsers will regenerate automatically during the build process.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • central.sonatype.com
    • Triggering command: /home/REDACTED/.local/bin/antlr4 antlr4 --version (dns block)
  • www.antlr.org
    • Triggering command: /usr/bin/wget wget -q REDACTED (dns block)
    • Triggering command: /usr/bin/curl curl -o antlr-4.13.2-complete.jar REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>bnf 语言部分, "->" 应该是 "=>"</issue_title>
<issue_description>多个地方需要修改

  1. bnf/*.g4
  2. bnf/apyds_bnf/*
  3. bnf/atsds_bnf/*
  4. bnf/README.md
  5. docs/support-packages/*</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.

Copilot AI self-assigned this Dec 20, 2025
Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix bnf language symbol '->' to '=>' in multiple files Change BNF arrow notation from -> to => Dec 20, 2025
Copilot AI requested a review from hzhangxyz December 20, 2025 02:54
@hzhangxyz
hzhangxyz marked this pull request as ready for review December 20, 2025 03:13
Copilot AI review requested due to automatic review settings December 20, 2025 03:13
@hzhangxyz
hzhangxyz merged commit ca80b0d into main Dec 20, 2025
78 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 the BNF language arrow notation from -> to => to align with standard BNF notation conventions. The change is consistently applied across the grammar definition, implementation code, documentation, and tests.

Key Changes:

  • Updated grammar rule syntax to use '=>' instead of '->'
  • Modified unparse visitors in both Python and JavaScript implementations to generate =>
  • Updated all documentation examples and test cases to reflect the new syntax

Reviewed changes

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

Show a summary per file
File Description
bnf/Dsp.g4 Updated grammar rule definition to use '=>' for rule arrows
bnf/apyds_bnf/init.py Modified UnparseVisitor.visitRule to generate => in output
bnf/atsds_bnf/index.mjs Modified UnparseVisitor.visitRule to generate => in output
bnf/README.md Updated all syntax examples in documentation to use =>
docs/support-packages/bnf.md Updated all syntax examples in documentation to use =>
bnf/tests/test_parse_unparse.py Updated all test cases including error scenarios to use new syntax
bnf/tests/test_parse_unparse.mjs Updated all test cases including error scenarios to use new syntax

💡 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