logicologist / knitscript

A language for easier design of knitting patterns
MIT License
13 stars 1 forks source link

Some row repeat errors can give error messages far away from the source #3

Open bamarsha opened 5 years ago

bamarsha commented 5 years ago

In the wibbly-wobbly.ks example, if I change repeat 3 to repeat 4 in upWobbly, the entire error message is:

error: expected 21 stitches, but only 19 are available
    at row repeat on line 30, column 2, in <empty>

which is actually referring to a completely different row repeat in wibblyWobbly. It's tricky since repeat 4 in upWobbly isn't wrong by itself, it's only wrong when combined with everything else, but it would be nice if the error message could mention that line, or at least the upWobbly pattern by name, somewhere in it.