Yes. 0.5 has a few bug fixes. You should definitly use it.
First, the easy one. I choose the #define macro #(parms) syntax because of whitespace. My parser cannot tell the difference between #define macro(parms) and #define macro (parms). Allowing it to do so - by having the lexer generate 'whitespace' tokens instead of just ignoring them - would require me to rewrite most of the parser. It's actually somewhat more friendly this way. For example, you don't need to start a directive right at the begining of the line.
And the hard one; this is perhaps best shown by example. You need to write a asIOutputStream that changes the filename/line number before outputting. Like I said, example...
#include <boost/regex.hpp>#include <boost/lexical_cast.hpp>Preprocessor::OutStream* error_stream = 0;Preprocessor::LineNumberTranslator LNT; std::string regex_expression = "^([a-zA-Z._\\/]+)[[:space:]]+\\((\\d+)";boost::regex expression(regex_expression);bool ParseErrorMessage(std::string& msg, int& num){ std::string::const_iterator start, end; start = msg.begin(); end = msg.end(); boost::match_results<std::string::const_iterator> results; boost::match_flag_type flags = boost::match_default; if (!boost::regex_search(start, end, results, expression, flags)) return false; std::string num_str = std::string(results[2].first, results[2].second); msg = std::string(results[0].second,end); num = boost::lexical_cast<int>(num_str); return true;}class ErrorTranslator: public asIOutputStream{public: virtual void Write(const char* text) { //Parse error message... if (!error_stream) return; int lnumber; std::string msgtext = std::string(text); if (ParseErrorMessage(msgtext,lnumber)) { (*error_stream) << LNT.ResolveOriginalFile(lnumber) << " (" << LNT.ResolveOriginalLine(lnumber) << msgtext; } else { (*error_stream) << std::string(text); } }};ErrorTranslator as_error_stream;Preprocessor::VectorOutStream VOS; bool error = false;Preprocessor::preprocess(script,*file_source,VOS,*error_stream,&LNT);
If you then use as_error_stream in asIScriptEngine::build, it will modify the error messages and re-emit them.