Parser
Parser
The Parser
takes a notation string and parses it into objects.
It is used internally by the DiceRoll object when rolling notation, but can be used by itself if necessary.
Kind: global class
See
- https://dice-roller.github.io/documentation/guide/notation/
- https://en.m.wikipedia.org/wiki/Dice_notation
Array
Parser.parse(notation) ⇒ Parses the given dice notation and returns a list of dice and modifiers found
Kind: static method of Parser
Throws:
RequiredArgumentError
Notation is requiredSyntaxError
The notation syntax is invalidTypeError
Notation must be a string
Param | Type | Description |
---|---|---|
notation | string | The notation to parse |