There is existing guidance from the SE-0308 acceptance:
The core team believes that additional refinement of conditional compilation is something that the language would benefit from. As such, proposals extending support towards conditional compilation of repeated lexical constructs, e.g. elements within an array literal, would be welcome. For non-repeated constructs, there are potential issues with the parsing, for example in the removal of a binary operator may change the operator precedence of subsequent expressions, and this would require careful, deliberate handling. Such a change is not unreasonable, but would demand an appropriate level of design and care towards an implementation.
This guidance stands, and SE-0330 aligns with it. The Core Team is open to considering the lexer-based model, but it would need to presented as its own standalone pitch/proposal. The possibility that such a proposal could be written and accepted should not be used as a reason to reject proposals like SE-0330 that would be subsumed by the lexer model.
(Removes Core Team hat)
I personally would rather see a comprehensive proposal than a lot of piecemeal proposals. For the grammar-based approach, that would be a walk through the whole grammar with updates to allow #if
's everywhere they make sense. For the lexer-based approach, it's a model change that removes #if
handling from the grammar. I am personally inclined toward the grammar-based approach because I appreciate the ability to build basic syntax trees for the branch not taken, but I'm willing to be convinced.
Doug