Rubberduck parsing error when attempting to wrap a COM object property that is a VBA reserved word. #6161
Labels
antlr
Issue is easier to resolve with knowledge of Antlr4
bug
Identifies work items for known bugs
has-workaround
There is some way of working around this limitation / bug that is confirmed to work
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()
Expected behavior
No parsing error.
Screenshots
The text was updated successfully, but these errors were encountered: