Hi, I've been trying to learn OMeta using OMeta/JS and I seem to be getting stuck on something that should be really straightforward. If I have a grammar
ometa L <: Parser {
l letter:l -> l
}
L.match('h', 'l')
It produces the expected output
h
I can also use
ometa W1 <: Parser {
ls letter*:ls -> ls
}
W1.matchAll('hi', 'ls')
Which produces
[h, i]
But when I try to parse an entire word using
ometa W2 <: Parser {
word letter:l word:w -> (l + w)
| letter:l -> l
}
W2.match('hi', 'word')
//Also tried W2.matchAll('hi', 'word')
I get an error
match failed { errorPos=61 }
What am I misunderstanding, and how do I fix the W2 grammer to output 'hi'?