Class ConditionalCompilationBlocks
The shape of the #If blocks of a module (MS-VBAL §3.4): which source ranges are the branches of one block, whatever they evaluate to.
public sealed class ConditionalCompilationBlocks
- Inheritance
-
ConditionalCompilationBlocks
- Inherited Members
Remarks
A name can be declared in each branch of a #If block and be one declaration, whichever branch compiles: the branches are alternatives of one another.
A name declared twice in the same branch - or twice with no #If at all - is not an alternative of itself, but a duplicate. Telling them apart takes no
constant to be evaluated, only where each branch begins and ends; it is the structure that the evaluation of the constants (PrecompilerLiveBranchEvaluator)
then chooses a branch of.
Properties
None
A module with no #If block: nothing is an alternative of anything.
public static ConditionalCompilationBlocks None { get; }
Property Value
Methods
AreAlternatives(SourcePosition, SourcePosition)
Whether the declarations at first and second are in different branches of one block, so that at most one of them is ever compiled.
public bool AreAlternatives(SourcePosition first, SourcePosition second)
Parameters
firstSourcePositionWhere the first is declared.
secondSourcePositionWhere the second is declared.
Returns
Of(ImmutableArray<SyntaxNode>)
The blocks of a module, read off its precompiler trivia, nested ones included.
public static ConditionalCompilationBlocks Of(ImmutableArray<SyntaxNode> precompilerTrivia)
Parameters
precompilerTriviaImmutableArray<SyntaxNode>The module's
ModuleParseResult.PrecompilerTrivia.