Skip to content

\discretionary

yex.keyword.Discretionary(parser) #

Adds a discretionary break.

Source code in yex/keyword/other.py
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
@yex.decorator.control(
    vertical = False,
    horizontal = True,
    math = False,
    )
def Discretionary(parser):
    "Adds a [discretionary break](yex.box.DiscretionaryBreak.md)."

    symbols = {}

    for name in ['prebreak', 'postbreak', 'nobreak']:
        symbols[name] = list(parser.another(
            level='reading',
            on_eof='exhaust',
            bounded='balanced',
            ))

    return yex.box.DiscretionaryBreak(**symbols)