- 
                Notifications
    
You must be signed in to change notification settings  - Fork 316
 
Grammar - fix MID statement #4129
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
Conversation
| 
               | 
          ||
| [Category("Parser")] | ||
| [Test] | ||
| public void MidStatement() | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, we need negative tests, too to assert that an expression that contains a Mid() function does not get parsed as a mid statement. We also need equivalent tests for Mid$() statement/function.
For example, we definitely don't want something like If Mid$("foo", 1) = "f" Then to be treated as a Mid statement. The tests need to validate this.
          Codecov Report
 @@            Coverage Diff             @@
##             next    #4129      +/-   ##
==========================================
+ Coverage   52.55%   52.55%   +<.01%     
==========================================
  Files         963      963              
  Lines       33142    33140       -2     
==========================================
- Hits        17415    17414       -1     
+ Misses      15727    15726       -1
  | 
    
| 
           Also, make sure to check whether you can remove the "hack" from the resolver Rubberduck/Rubberduck.Parsing/Binding/Bindings/SimpleNameDefaultBinding.cs Lines 78 to 85 in c46cd4d 
  | 
    
| 
           I wonder if it's necessary to have additional unit tests to prove that it's not an undeclared variable to directly test the effect of the hack that was removed?  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving because resolving as a function is a huge step forward compared to resolving to an undeclared variable (i.e. not resolving it at all), however Mid$ needs to resolve to a String-returning function; the inspection for string-typed functions will be having false negatives until that's fixed.

Closes #4128
There were a few issues:
ASSIGNinstead ofEQlExpressioninstead ofexpressionmainBlockStmt