c2compiler
c2compiler copied to clipboard
Parser: improve error message handling
- use single
on_errorhandler with error level and message arguments - remove
Warningtoken type, never returned anyway. - improve
#errorand#warningmessage parsing consistency - make
num_errormessages non fatal - fix
#warningbehavior
It seems to make parsing slower... What was it that you were trying to improve?
It seems to make parsing slower...
This is surprising, the changes should not affect the inner loops, only the error cases.
What was it that you were trying to improve?
I was just trying to improve the consistency:
- both warnings and errors should be produced synchronously,
#warningused to output an error withon_warning, itself usingdiag.errorinstead ofdiag.warnnum_errorare errors, not warnings, but non fatal.#errorreturned an error token without showing the error message.