Hi, as I mentioned a few days ago, since this function grew rather big, I hope to clean it up a bit. For now at least nothing ground shaking: I moved together some declarations and initializations; in other cases exploited the opportunity C++ gives to defer declarations; consistently changed some int flags to bool (and avoiding names ending by *p for non bools); plus rather obvious stylistic tweaks (like wrapping way overlong lines). I'm also improving a bit the diagnostics - see the new testcases - telling apart and in two error messages. It's a start. How does it look to you? Tested x86_64-linux. Thanks, Paolo. /////////////////////////////