Update grammar README to reflect actual parser behavior

The documentation stated that non-terminal symbols must be 'dashed lowercase
words' like 'move' or 'check-mate', but the actual parser supports much more
flexibility. Rule names can include:
- Uppercase letters (e.g., dataType, UPPER-CASE)
- Numbers (e.g., rule123)
- Both dashes and underscores

This was discovered when c.gbnf used 'dataType' with an uppercase letter,
which works correctly despite the documentation saying otherwise. Updated
the docs to accurately describe the parser's capabilities rather than
restrict them.

Fixes #7720

Signed-off-by: Samaresh Kumar Singh <ssam3003@gmail.com>
This commit is contained in:
Samaresh Kumar Singh 2025-11-17 15:25:56 -06:00
parent 0de8878c96
commit 69447f879f
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ castle ::= ...
## Non-Terminals and Terminals
Non-terminal symbols (rule names) stand for a pattern of terminals and other non-terminals. They are required to be a dashed lowercase word, like `move`, `castle`, or `check-mate`.
Non-terminal symbols (rule names) stand for a pattern of terminals and other non-terminals. Rule names can be composed of letters (both uppercase and lowercase), numbers, dashes, and underscores. For example: `move`, `castle`, `check-mate`, `dataType`, `UPPER-CASE`, or `rule_123` are all valid non-terminal names.
Terminals are actual characters ([code points](https://en.wikipedia.org/wiki/Code_point)). They can be specified as a sequence like `"1"` or `"O-O"` or as ranges like `[1-9]` or `[NBKQR]`.