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
Grammar doesn't understand function's array return value being accessed in the same instruction #749
Comments
Any chance you have the error message from the parser handy? |
The grammar doesn't understand that a function can return an array that's accessed immediately; the grammar rule allows for chained member calls, but the array or procedure call rule is currently standing on its own, which means... Repro:
Work-around:
By splitting the call on two instructions, the grammar rules are satisfied and the parser understands what's going on. Not ideal, but note taken - we'll see how the grammar can be tweaked to understand that an array call can be made there. |
and what about Dir$ error?
|
@yadimon Interesting. The same code using My guess is that the
We might need to special-case |
Just to stress the importance of this issue: I tried Rubberduck with a medium complex project where I'm using this construct (function's array return value immediately indexed) quite frequently. Unfortunately the parser breaks, showing only the first parse error and parsing would never come to an end (showing VBProject parsing ... indefinitely, refresh not working). No time to change dozens of lines just to get code explorer working. But Rubberduck seems very promising and a quantum leap in vba coding assistance. I'll definitely take a closer look and dive into debugging RD itself, meanwhile KEEP GOING! Cheers |
@manfredk thanks! I see you forked the project - feel free to contact me anytime if you have questions... I haven't really documented how to compile the ANTLR grammar and re-generate the parser and other needed base classes... I need to do that. I'm currently working on reconnecting the pieces (see #759), and that a lot of the issues linked there are "up-for-grabs", as a result of #606. In the process, we're swapping some WinForms UI for some WPF/XAML, toward a MVVM approach. This change is far from being just cosmetic, and significantly simplifies and organizes the code base... on top of being more elegant in both Visual Studio and the VBE. I was planning on implementing the grammar fixes after I get the code inspections and regex search/replace up, so a number of weeks still; I'll gladly accept a PR that fixes grammar issues before I get to them! 😃 |
Hi Mathieu, I did a project with VSTO in 2013 (Excel only), but Rubberduck is far more Again, great work !!. I'm curious about v2. Cheers, Manfred On Sun, Sep 13, 2015 at 5:40 AM, Mathieu Guindon notifications@github.com
Manfred Kipfelsberger, Schwabacher Str. 129, 90763 Fürth |
Hi @manfredk, this is the current translator for German locale speaking 😄 You can find the current Translation under If you need something to make this nasty XML file look better, you may want to check Greets, Vogel612 |
Hey there @manfredk. I can completely understand having other things to do, but don't let ANTLR scare you away. You couldn't fix this issue without learning a bit about it, but there are lots of other areas that could use some TLC. All PRs are considered, we're always happy for any help we get. We hope that you'll come back around down the road and contribute. Cheers |
@Vogel612 Hi Clemens, good to know, I'll have a look. |
Looks like this issue is now fixed on my fork and will be closed when I merge my changes in 😃 |
Hi, I tried some RD function over some projects,
the parser shows error, but for different lines, somewhere near the code examples.
The following code examples generates errors for Parser:
somevar = Split(anyvar, "anystring")(0)
(the last part is the problem)and
Dir$
The text was updated successfully, but these errors were encountered: