Skip to main content

Module expr

Module expr 

Source
Expand description

Parsing helpers for compact dice roll expressions. Parsers for compact dice roll expressions.

Expressions are provided as already-tokenized command-line style strings, such as ["3d6", "d20", "5"]. Dice counts are expanded into repeated die names and integer tokens are treated as modifiers where allowed.

Structs§

ParsedRoll
Parsed roll input.

Functions§

parse_dice_only_exprs
Parses dice expressions and rejects integer modifiers.
parse_roll_exprs
Parses dice expressions and integer modifiers.