Dice roll grammar lexer

Hi @dimitarvp!

Thanks for the heads up…
I didn’t mean the whole thing, it was just an example :sweat_smile:.
I want to start with basic dice notation, for example:

  • NdN
  • NdN + N; NdN - N; NdN * N; NdN / N
  • NdN + NdN; NdN - NdN; NdN * NdN; NdN / NdN
  • ((NdN) * 2) + NdN

And so on… “Basic” operations include only: +; -; *; / and (; ) for grouping expressions.
The order is not important, so something like N + NdN or 2 * 2 + (NdN + 3) should still be parsed.

I intend to expand it after with other modifiers, but first I need to wrap my head around it.
There’s another page that seems to be a little bit more concise on the topic here.