uwol / proleap-vb6-parser

ProLeap ANTLR4-based parser for Visual Basic 6.0
MIT License
79 stars 26 forks source link

VB6 string concatenation with TextBox.Text$ not working #1

Closed maxiz closed 7 years ago

maxiz commented 7 years ago

I'm using the VB6.g4 grammar file. It seems to throw an exception on statements like filepath$ = filename.Text$ & "\abc" & filepath$ & ".txt" and If Func1(filname.Text$ & "\Logfiles", True) = True Then. Removing the $ from filename.Text$ would solve the issue but I would've expected the grammar to successfully match the statement. So I'm trying to understand why $ is throwing off the parser.

Any help in identifying the problem is much appreciated!

uwol commented 7 years ago

Yes, type hints should be parsed by the grammar. Let's see, if we can identify the problem.

To reproduce the problem, I added a unit test TypeHintTest.java that parses TypeHint.cls containing the expressions given by you. The test passes. Also the parse tree TypeHint.cls.tree seems to be correct.

Could you please provide a modified version of TypeHint.cls, which reproduces the problem? Thanks!

maxiz commented 7 years ago

I tried to reproduce my issue by modifying the TypeHint.cls file, but the test passed fine. So I'm closing this issue. Thank you for helping :)