Closed retailcoder closed 8 years ago
I'll take a look at this. Theoretically, a comment node begins with a comment identifier (an apostrophe or REM) and ends on a newline, unless there is a line continuation.
Yes. Grammar knows this... and skips them. I tried a parser that un-skipped them and didn't get the expected comment nodes. Trial-and-error is not a fun thing to do here - need a tool to run the generated parser against some VBA code, before saying "ok that's the one" and overwriting the files in Rubberduck.
Yup. Just spotted it. https://github.com/retailcoder/Rubberduck/blob/LexicalTokens/RetailCoder.VBE/VBA/Grammar/VisualBasic6.g4#L876
Comments on their own lines shouldn't be a problem, but I have a feeling that basically all of the other "statements" will need to be modified for situations like this.
If foo Then ` this comment tosses wrenches
bar
End If
Do you have a VB6 file that you were working with to test the parser? I will probably create a new project to work with this.
Related: #163 (rename grammar rules to follow C# naming conventions); closing this issue should also close #166.