-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse error on Private Type definition #6194
Comments
Looks like an oversight in the parser grammar around UDT member definitions. |
Seems to be taken into account though:
Specifically:
Just to be sure, the
In other words, in order to parse a |
Yes, my Type Definition ends correctly with the "End Type" token in the last line.
|
It looks like the VBA language specification does not allow user defined types to include array members without an
In the above example, the 4 members should be identical i.e. arrays of variants with lower bound 0 and upper bound 2. However, VBA will only allow cases A, B and D. Rubberduck only allows A and B. So to support the reality of what works in VBA, we would need to change the VBAParser.g4 definition to explicitly allow UDT members to have an array with both lower and upper bounds but not a type. An odd special case. |
So this is one of the few areas where the VBE implementation mismatches its own specifications. |
Submitted a fix which allow Rubberduck to parse cases where there is an array member of the UDT which doesn't have an explicit type declaration. It still requires a type declaration for non-array members as that is consistent with both the language specification and implementation. |
Write a Type Definition in a class module of the form:
Throws a Parse Error at the end of FMT(0 To 2)
The text was updated successfully, but these errors were encountered: