Open mewmew opened 6 years ago
Yes, I agree and will fix this. Originally, I wanted to support the following style of writing productions but in practice it turned out to be very confusing.
a := rule1 ;
a := rule2 ;
Yes, I agree and will fix this. Originally, I wanted to support the following style of writing productions but in practice it turned out to be very confusing.
Ok, then I understand the background for this. Glad that it will be fixed! It's caused me a bit of confusion thus far.
I noticed today that the grammar I was writing contained a typo where two different rules had the same name.
From https://github.com/mewmew/l-tm/commit/27348902c0b25e99209f9b78cb7f3f41f74c82af
What surprised me was that Textmapper did not report any error or warning for this grammar, so it may have gone unnoticed for much longer.
I would like to suggest that Textmapper reports an error or outputs a warning when a grammar contains two rules of the same name. It is quite possible that a valid grammar may contain two rules with the same name for some of the more advanced use cases of Textmapper. Of this, I'm not yet aware. However, in the context of a simple grammar, a warning would be helpful.
Cheers, Robin