Struct ModuleDirectives
The resolved module-level directives a VBModuleSymbol was declared under — the
Option ... statements (MS-VBAL §5.2.1) and Attribute VB_...
declarations (MS-VBAL §4.2) a static-semantics pass needs to know about, plus
RD-VBA's own annotation-driven dials (Option Strict).
public readonly record struct ModuleDirectives : IEquatable<ModuleDirectives>
- Implements
- Inherited Members
Remarks
Named Directives, not Options: MS-VBAL's own Option statements are only
one source feeding this — Attribute declarations (VB_Name, VB_PredeclaredId,
…) and RD-VBA annotations belong here too, as this grows one property at a time. A consumer that
needs a new directive adds a property to this record; nothing that carries a
ModuleDirectives — VBModuleSymbol, LexicalScope,
StaticEvaluationContext — ever changes shape because of it.
Constructors
ModuleDirectives(bool, bool)
The resolved module-level directives a VBModuleSymbol was declared under — the
Option ... statements (MS-VBAL §5.2.1) and Attribute VB_...
declarations (MS-VBAL §4.2) a static-semantics pass needs to know about, plus
RD-VBA's own annotation-driven dials (Option Strict).
public ModuleDirectives(bool Explicit = false, bool Strict = false)
Parameters
ExplicitboolWhether the module declares
Option Explicit(MS-VBAL §5.2.1.3) — an unresolvedSimpleNameis a compile error under this module, not a deferred/inferred type.StrictboolWhether the module carries RD-VBA's
'@OptionStrictannotation — turns select semantic flags that stay legal under plainOption Explicitinto compile errors.
Remarks
Named Directives, not Options: MS-VBAL's own Option statements are only
one source feeding this — Attribute declarations (VB_Name, VB_PredeclaredId,
…) and RD-VBA annotations belong here too, as this grows one property at a time. A consumer that
needs a new directive adds a property to this record; nothing that carries a
ModuleDirectives — VBModuleSymbol, LexicalScope,
StaticEvaluationContext — ever changes shape because of it.
Fields
None
The directives of a module that declares none of them explicitly.
public static readonly ModuleDirectives None
Field Value
Properties
Explicit
Whether the module declares Option Explicit (MS-VBAL §5.2.1.3) — an
unresolved SimpleName is a compile error under this module, not a deferred/inferred type.
public bool Explicit { get; init; }
Property Value
Strict
Whether the module carries RD-VBA's '@OptionStrict annotation — turns select semantic
flags that stay legal under plain Option Explicit into compile errors.
public bool Strict { get; init; }