Skip to content

Commit

Permalink
docs: tweak the minimal syntax diagram
Browse files Browse the repository at this point in the history
It now uses a simpler layout for the optional empty paths, and the type
is explicitly optional.
  • Loading branch information
h4l committed Aug 9, 2023
1 parent 396e59b commit 921b6b7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
8 changes: 4 additions & 4 deletions docs/syntax-diagrams/jb_arg_syntax_diagrams.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ def argument() -> DiagramItem:

def minimal_arg() -> DiagramItem:
"""A high-level summary of the argument structure."""
return OptionalSequence(
NonTerminal("key"),
Sequence(":", NonTerminal("type")),
Sequence(Choice(0, "=", "@"), NonTerminal("value")),
return Sequence(
Optional(NonTerminal("key")),
Choice(0, Sequence(":", Optional(NonTerminal("type"))), Skip()),
Optional(Sequence(Choice(0, "=", "@"), NonTerminal("value"))),
)


Expand Down
32 changes: 20 additions & 12 deletions docs/syntax-diagrams/minimal-argument.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 921b6b7

Please sign in to comment.