skx / evalfilter

A bytecode-based virtual machine to implement scripting/filtering support in your golang project.
GNU General Public License v2.0
117 stars 12 forks source link

Parser error-handling #150

Closed skx closed 4 years ago

skx commented 4 years ago

Every time a parse-function returns nil there should be a corresponding addition to p.Errors().

Otherwise the user will not receive the correct error-message. (Of course as a result of #144 only the first error will be shown by default, all other errors are accessible - but in practice they're a little bogus once the parse gets thrown off. The parser needs to resync, and restart parsing after skipping to the end of the statement. Without a terminating ; that becomes a tricky thing to do though.)

skx commented 4 years ago

153 improved this a little. There is probably more room to improve, as the parser has only 87% test-coverage. I'll work on that shortly.