Closed jnbbender closed 3 years ago
i think that is talking about the whole m/s bit not just the /
try changing spd_unit: ['mps','m/s','mph'],
to spd_unit: { match: /m(\/s|ph|ps)/ }
? if not im not sure
That one didn't work
Turns out I had another Moo rule that got in the way:
alt_unit: ['meter','mtr','m','feet','ft']
It was resolving to the m
in the %alt_unit rule. Apologies for not posting a more complete example.
I am currently writing the following:
This is a very stripped down version.
When I do the following:
nearley-test ./grammar.js --input "speed m/s"
I get at syntax error atspeed m
How do I handle a forward slash? I tried escaping it and double-quoting but that did not work.