def-gthill / lexurgy

A high-powered sound change applier
GNU General Public License v3.0
44 stars 5 forks source link

location notification for unequal left and right element count #20

Closed AdamantConlanger closed 3 years ago

AdamantConlanger commented 3 years ago

"found 2 elements on the left and 1 on the right at line 225, column 45" doesn't help much if you don't know at what rule this happened, especially since the current format doesn't display line and column numbers.

def-gthill commented 3 years ago

Thanks for reporting, I'll make this error message more helpful.

AdamantConlanger commented 3 years ago

thank you for replying so quickly. sorry if it isn't helpful.

def-gthill commented 3 years ago

I've reworked the error reporting system in commit bc900d6aac40101b5b622f181e073d3901642747. In the next release, if you have a "number of elements" mismatch, like this:

bad-rule:
    a => b c

then you'll get an error message like this:

Error in expression 1 ("a => b c") of rule "badrule" Found 1 element ("a") on the left side of the arrow but 2 elements ("b", "c") on the right side

The first line giving the rule name and expression should appear on many other kinds of errors as well.