Skip to content

Rubberduck parsing error when attempting to wrap a COM object property that is a VBA reserved word. #6161

Open
@MarkJohnstoneGitHub

Description

@MarkJohnstoneGitHub

Rubberduck version information
Version 2.5.9.6296
OS: Microsoft Windows NT 10.0.19045.0, x64
Host Product: Microsoft Office 2016 x64
Host Version: 16.0.5317.1000
Host Executable: MSACCESS.EXE

Description
Rubberduck parsing error when attempting to wrap a COM object property that is a VBA reserved word.

To Reproduce
Require a COM object with a property name that would conflict with a VBA reserved word.
For the example the COM object MatchSingleton has a property named Empty as displayed screenshot.

When attempting to wrap the MatchSingleton.Empty property, displayed below and selecting the RD parse icon it produces a 'Parse Error'. Commenting out the Set EmptyMatch = this.MatchSingleton.Empty() there is no parse error.
Notes:
Renamed the wrapper property to EmptyMatch as Empty is VBA reserved word.
Code compiles.

To avoid the Rubberduck 'Parse Error' issue I've renamed the COM object property MatchSingleton.Empty property to MatchSingleton.EmptyMatch and parses ok. i.e. Set EmptyMatch = this.MatchSingleton.EmptyMatch()

'@Description("Gets the empty group. All failed matches return this empty match.")
Public Property Get EmptyMatch() As DotNetLib.Match
   Set EmptyMatch = this.MatchSingleton.Empty()
End Property

Expected behavior
No parsing error.

Screenshots
image
image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    antlrIssue is easier to resolve with knowledge of Antlr4bugIdentifies work items for known bugshas-workaroundThere is some way of working around this limitation / bug that is confirmed to work

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions