Table of Contents

Class ConditionalCompilationBlocks

Namespace
RDCore.SDK.Semantics
Assembly
RDCore.SDK.dll

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

ConditionalCompilationBlocks

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

first SourcePosition

Where the first is declared.

second SourcePosition

Where the second is declared.

Returns

bool

Of(ImmutableArray<SyntaxNode>)

The blocks of a module, read off its precompiler trivia, nested ones included.

public static ConditionalCompilationBlocks Of(ImmutableArray<SyntaxNode> precompilerTrivia)

Parameters

precompilerTrivia ImmutableArray<SyntaxNode>

The module's ModuleParseResult.PrecompilerTrivia.

Returns

ConditionalCompilationBlocks