Tokenizes a dice notation string. The first stage of the pipeline —
parse calls it for you; reach for lex directly only to build a
syntax highlighter or an editor integration.
Notation is case-insensitive and whitespace-tolerant: 2D20 + 5 and
2d20+5 produce the same tokens, and identifier tokens carry a lowercased
value. The one exception is @name, whose case is preserved.
Tokenizes a dice notation string. The first stage of the pipeline — parse calls it for you; reach for
lexdirectly only to build a syntax highlighter or an editor integration.Notation is case-insensitive and whitespace-tolerant:
2D20 + 5and2d20+5produce the same tokens, and identifier tokens carry a lowercasedvalue. The one exception is@name, whose case is preserved.