on-internet
← Community

Is there a better way to define a decimal in an MGrammar?

Stack Overflow ·

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.

Comments

Sign in or sign up to comment and upvote.

No comments yet.