logicologist / knitscript

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

Some syntax errors cause AST generation to fail without a useful error message #2

Open bamarsha opened 5 years ago

bamarsha commented 5 years ago

row: K to endf. gives the error message "error: extraneous input 'f' expecting '.'", which makes sense, but a similar typo row: K to en. gives the very unhelpful message "error: unsupported parser context NoneType". I think the difference is that in the first one, ANTLR is able to parse the row (just with an extraneous character), but in the second one, ANTLR isn't able to recognize the row at all, so something goes wrong in build_ast.