Skip to content
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 related to antlr4.6 update in .2809 prerelease build #3741

Closed
Stevefb opened this issue Jan 31, 2018 · 6 comments · Fixed by #3744
Closed

Parse Error related to antlr4.6 update in .2809 prerelease build #3741

Stevefb opened this issue Jan 31, 2018 · 6 comments · Fixed by #3744
Labels
antlr Issue is easier to resolve with knowledge of Antlr4 bug Identifies work items for known bugs critical Marks a bug as a must-fix, showstopper issue has-workaround There is some way of working around this limitation / bug that is confirmed to work

Comments

@Stevefb
Copy link

Stevefb commented Jan 31, 2018

Using the prerelease build .2809, this code generates a parse error:

Public Sub Foo()
    Dim a As Integer
    Dim b As Integer
    Dim c As Integer
    a = 1
    b = 2
    c = a - b  ' <<<<<<<< Parse Error, No alternative input 
    Debug.Print c
End Sub
@Stevefb
Copy link
Author

Stevefb commented Jan 31, 2018

Just confirmed the issue is NOT in Rubberduck v2.1.2.2803-pre

@retailcoder retailcoder added bug Identifies work items for known bugs antlr Issue is easier to resolve with knowledge of Antlr4 critical Marks a bug as a must-fix, showstopper issue labels Jan 31, 2018
@ThunderFrame
Copy link
Member

looks like it might be related to B_CHAR. Do you get the same parse error when the b variable is named something other than b?

@MDoerner
Copy link
Contributor

It cannot be B_Char since that does not exist anymore.

@Vogel612
Copy link
Member

it's probably LETTER_RANGE. Could you check whether the problem persists if you rename a to something with more than a single letter?

@Stevefb
Copy link
Author

Stevefb commented Feb 1, 2018

Thanks guys, confirmed that changing variable name from 'a' to something else works-around the parse error.

Public Sub Foo()
    Dim aye As Integer
    Dim b As Integer
    Dim c As Integer
    aye = 1
    b = 2
    c = aye - b
    Debug.Print c
End Sub

@quentinharris
Copy link

quentinharris commented Feb 1, 2018

Appears to be that single letter followed by a '-' will raise the error. So single letter variables then space then "-" cause this. Lengthening the string e.g. 'ab' rather than 'a' avoids this. I tried different single letters and operators. Interestingly you can have a - -b but not a - b. As @MDoerner has mentioned in chat, this is more precisely raised by singleLetter hyphen singleLetter.

@Vogel612 Vogel612 added the has-workaround There is some way of working around this limitation / bug that is confirmed to work label Feb 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
antlr Issue is easier to resolve with knowledge of Antlr4 bug Identifies work items for known bugs critical Marks a bug as a must-fix, showstopper issue has-workaround There is some way of working around this limitation / bug that is confirmed to work
Projects
Development

Successfully merging a pull request may close this issue.

6 participants