leanprover / leanprover/verso

Typeset a single `grammar` block with multiple productions

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

Nobody has claimed this yet.

enhancement
Dominant language
Lean
Stars
384
Forks
124
Avg merge
22h 28m
Merged PRs (30d)
10

Description

I'd like to typeset several productions of a grammar at once, such that it displays roughly as

term ::= ...
  | term + term
  | term * term
  | term / term

I tried the subjectively intuitive thing, writing one grammar block and separating each production by a newline:

```grammar
$_:term + $_:term
$_:term * $_:term
$_:term / $_:term
```

But that displays as

term ::= ...
  | term + term
    term * term
    term / term

and actually parses everything as one big production, it seems.

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start by reproducing the issue's grammar block example in Verso and inspect how consecutive productions are parsed and rendered. Done means separate productions display as alternatives, with each line after the first prefixed by |, rather than being treated as one production.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.