Advanced lexer error reporting