On Sat, 20 Nov 2010 04:14:05 +0300, Walter Bright <newshou...@digitalmars.com> wrote:

Andrew Wiley wrote:
I'm a fan of parsing false version blocks, but it seems like there should be some sort of exception for version blocks for a different version of the language. Could they just be skipped with a warning that an unknown version of the language is in use? It's somewhat hackish, but to me, that seems better than parsing it and giving an error because of syntax changes.


How can it skip it without knowing the grammar?

#ifdef D_Version2
...
#else
...
#endif


D has a precedence of having preprocessor macros (e.g #line) even if it's not a full-fledged preprocessor, and I don't see why it couldn't adapt the same solution.

FWIW, C# has #if blocks, too.

Reply via email to