Support BNFs with multiple productions in `syntax` blocks

Open
#966 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
68/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Domain
documentation

Research direction

Locate the code that parses the :::freeSyntax and :::syntax directives plus the ```grammar fences, then compare how freeSyntax splits on the `` separator versus how `syntax` currently emits one BNF per fence. Start by grepping for `freeSyntax` and `` to find the shared rendering path. Done = the two-fence example in the issue renders as a single BNF with two productions, verified by building the manual.

Written by the indexing model from the issue text.

Description

The freeSyntax directive can render a single BNF with multiple productions. This is expressed by separating the productions with *****. For instance

:::freeSyntax json (title := "JSON Literals") -open
```grammar
`( json|null)
*****
`( json|true)
```
:::

The syntax directive should also support multi-production BNFs; the following example is currently rendered as two BNFs:

:::syntax json (title := "JSON Terms")
```grammar
null
```
```grammar
true
```
:::
Dominant language
Lean
Stars
147
Forks
72
Avg merge
1d 17h
Merged PRs (30d)
23

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from leanprover/reference-manual

All issues in leanprover/reference-manual

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.