I tried to learn OMeta using OMeta / JS and I seem to be fixated on something that should be very simple. If i have 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')
What produces
[h, i]
But when I try to parse a whole 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 I donβt understand, and how to fix W2 grammars for hi output?
source share