In files where different preprocessing paths are possible, our goal is to
choose a preprocessed token sequence which we can parse that pins down as much
of the grammatical structure as possible.
This forms the "primary parse", and the not-taken branches get parsed later,
and are constrained to be compatible with the primary parse.
Concretely:
int x = #ifdef // TAKEN 2 + 2 + 2 // determined during primary parse to be an expression #else 2 // constrained to be an expression during a secondary parse #endif ;
off-topic: a random idea on the name of DirectiveMap came up to my mind when reading the code, how about DirectiveTree, the comment of it says the structure is a tree, and the BranchChooser is actually a tree-visiting pattern.