Skip to content

[Bug] Compiler directives not pre-parsed in certain circumstances. #32

@SSlinky

Description

@SSlinky

Describe the bug
Compiler directives not pre-parsed in certain circumstances.

To Reproduce
Use compiler directives, e.g., #If cond Then ... [#Else]... #End If after a some code. Not caused by all code, e.g., declaring Measureme will break but Measurem will not. It does not appear to be related to identifier length.

Code (if relevant)

Attribute VB_Name = "CompilerDirectives"

Option Explicit

Public Measureme As ListObject

#If Win64 Then
    Public Declare PtrSafe Function SetWindowPos _
        Lib "user32" ( _
            ByVal hWnd As LongPtr, _
            ByVal hwndInsertAfter As LongPtr, _
            ByVal x As Long, ByVal y As Long, _
            ByVal cx As Long, ByVal cy As Long, _
            ByVal wFlags As Long) _
    As Long
#Else
    Public Declare Function SetWindowPos _
        Lib "user32" ( _
            ByVal hWnd As Long, _
            ByVal hwndInsertAfter As Long, _
            ByVal x As Long, ByVal y As Long, _
            ByVal cx As Long, ByVal cy As Long, _
            ByVal wFlags As Long) _
    As Long
#End If

Expected behavior
One condition block should grey out as not relevant to current config.

Screenshots

Image

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions