#dice #parser #dnd #ttrpg

genesys-dice-command-parser

A library for parsing basic Genesys dice roll commands

2 releases

0.1.1 May 18, 2022
0.1.0 May 17, 2022

#1910 in Parser implementations


Used in genesys-dice-roller

MIT license

14KB
252 lines

Dice Command Parser

This library parses a simple Genesys dice roll string (also works for Star Wars FFG RPG) and produces a representation of the dice that should be rolled and its modifier.

Example input: 2g1r1p, yyypp, difficulty difficulty ability proficiency etc.


lib.rs:

This crate provides functionality for the basic parsing of dice roll commands e.g. yyypp, 2g1y2p, difficulty difficulty ability proficiency. Given some input it will produce a DiceRoll struct which can be used to then calculate a result.

Dependencies

~1.2–1.9MB
~38K SLoC