I'm working on a DSL in Microsoft's new M Grammar, and it needs to allow decimal values. I've defined decimal as
token digits = "0".."9";
token spot = ".";
token decimal = digits+ | digits+ spot digits+ | spot digits+;
That seems to work, but is there a better way? It just feels like I'm missing something.