refactor so lexer+parser keeps track of errors
Merge pull request #4094 from WalterBright/lexer-errors

refactor so lexer+parser keeps track of errors