Variable reference prefix: '@'
Argument separator: ','
Critical failure threshold: 'cf'
Critical success threshold: 'cs'
Dice operator: 'd' or 'D'
Fate/Fudge dice operator: 'dF'
Percentile dice operator: 'd%' (alias for d100)
Division operator: '/'
Drop highest modifier: 'dh'
Drop lowest modifier: 'dl'
End of input marker
Equal: '='
Standard explode: '!'
Compounding explode: '!!'
Penetrating explode: '!p'
Fail marker: 'f'
Math function: 'floor', 'ceil', 'round', 'abs', 'sqrt', 'pow', 'max',
'min'. In postfix position, 'min'/'max' double as per-die clamp
modifiers (4d6min2) — the parser decides by position, not the lexer.
Greater than: '>'
Greater than or equal: '>='
Keep highest modifier: 'kh' or 'k'
Keep lowest modifier: 'kl'
Left brace: '{'
Less than: '<'
Less than or equal: '<='
Left parenthesis: '('
Subtraction operator: '-'
Modulo operator: '%'
Multiplication operator: '*'
Numeric literal: integer or decimal
Addition operator: '+'
Power operator: '**' or '^'
Right brace: '}'
Recursive reroll: 'r'
Reroll once: 'ro'
Right parenthesis: ')'
Ascending sort: 's' or 'sa'
Descending sort: 'sd'
Versus operator: 'vs'
Token types for dice notation.
Grouped semantically. Numeric values are stable identifiers — the specific numbers don't matter, but they must be unique.