ohmjs / ohm

A library and language for building parsers, interpreters, compilers, etc.
MIT License
5.01k stars 217 forks source link

toString fails with mysterious message due to bug #381

Closed guitarvydas closed 2 years ago

guitarvydas commented 2 years ago

https://github.com/guitarvydas/cparse/blob/report/insert.html#L59

I created erroneous code and hit a JS error. It would be nicer if toString() were to give a better error message...

I forgot to call the appropriate semantic function, then called .toString().

.toString() failed with "undefined", which did not help to figure out what was wrong...

You should be able to load "insert.html" into a browser and hit the "insert" button. .toString() then fails on the code at line 59.