Change BNF arrow notation from -> to => - #122
Merged
Merged
Conversation
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
hzhangxyz
approved these changes
Dec 20, 2025
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 examplesdocs/support-packages/bnf.md: Updated all syntax examplesTests
bnf/tests/test_parse_unparse.py: Updated test expectationsbnf/tests/test_parse_unparse.mjs: Updated test expectationsExample
Before:
After:
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/home/REDACTED/.local/bin/antlr4 antlr4 --version(dns block)www.antlr.org/usr/bin/wget wget -q REDACTED(dns block)/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
💡 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.