Hi,
this is more of a question than an issue about Moo, so here goes:
I have the following lexer:
const lexer = moo.compile({
TERM: /[a-z]+/,
PREFIXTERM: /\*|(?:[a-z]+\*)/,
});
On input moo, this will return:
{"type":"TERM","value":"moo","text":"moo","offset":0,"lineBreaks":0,"line":1,"col":1}
On input moo* I would want it to return a single PREFIXTERM, but I'm getting this instead:
{"type":"TERM","value":"moo","text":"moo","offset":0,"lineBreaks":0,"line":1,"col":1}
{"type":"PREFIXTERM","value":"*","text":"*","offset":3,"lineBreaks":0,"line":1,"col":4}
How can I get it to go for a single PREFIXTERM?
Hi,
this is more of a question than an issue about Moo, so here goes:
I have the following lexer:
On input
moo, this will return:{"type":"TERM","value":"moo","text":"moo","offset":0,"lineBreaks":0,"line":1,"col":1}On input
moo*I would want it to return a singlePREFIXTERM, but I'm getting this instead:{"type":"TERM","value":"moo","text":"moo","offset":0,"lineBreaks":0,"line":1,"col":1} {"type":"PREFIXTERM","value":"*","text":"*","offset":3,"lineBreaks":0,"line":1,"col":4}How can I get it to go for a single PREFIXTERM?