Logging of AST in case of matter_compiler failure

https://trello.com/c/16lRl7FW/1793-fix-matter-compiler