Issue 9497 - ddoc: add support for handling undefined macros

Fresh approach replacing https://github.com/D-Programming-Language/dmd/pull/1653
add: `assert(p);`