diff options
Diffstat (limited to 'syntax/def_Paragraph.py')
| -rwxr-xr-x | syntax/def_Paragraph.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/syntax/def_Paragraph.py b/syntax/def_Paragraph.py new file mode 100755 index 0000000..2f8e68d --- /dev/null +++ b/syntax/def_Paragraph.py @@ -0,0 +1,23 @@ +#!/usr/bin/python3 + +# Copyright 2025, Jonas Smedegaard <dr@jones.dk> +# SPDX-License-Identifier: GPL-3+ + +from os.path import basename, splitext +from railroad import * + +Diagram( + NonTerminal("Words"), + Choice(0, + OneOrMore( + NonTerminal("HardBreak"), + NonTerminal("Words") + ), + Skip() + ), + OneOrMore( + NonTerminal("NEWLINE") + ), + type="complex" +).writeStandalone( + open(splitext(basename(__file__))[0] + ".svg", "w").write) |
