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

Recent Grammar issues #6196

Merged
merged 4 commits into from
Jan 28, 2024
Merged

Recent Grammar issues #6196

merged 4 commits into from
Jan 28, 2024

Conversation

tommy9
Copy link
Member

@tommy9 tommy9 commented Jan 27, 2024

Fixes for #6187, #6194

Single line if statements had been made too flexible, in particular the rule ifWithEmptyThen where all the elements following the THEN were optional, letting the singleLineIfStmt match what is really an ifStmt:

ifWithEmptyThen : IF whiteSpace? booleanExpression whiteSpace? THEN whiteSpace? emptyThenStatement? singleLineElseClause?;

Now the rule requires at least one of emptyThenStatement or singleLineElseClause.

The user defined type member rule has been modified to allow the asTypeClause to be omitted but only if the member is an array. This ensures valid (though not defined in the language specification) examples through as in #6187

optionalArrayClause : ((arrayDim whiteSpace)? asTypeClause | arrayDim);

@rubberduck-vba-releasebot
Copy link
Member

Copy link

codecov bot commented Jan 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (22b5a72) 97.34% compared to head (c7b7d38) 97.58%.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #6196      +/-   ##
==========================================
+ Coverage   97.34%   97.58%   +0.24%     
==========================================
  Files           4        4              
  Lines         413      413              
  Branches       28       28              
==========================================
+ Hits          402      403       +1     
  Misses          6        6              
+ Partials        5        4       -1     

see 1 file with indirect coverage changes

@MDoerner
Copy link
Contributor

Thanks for working on the mess I caused. I would have liked to do it myself for a whole, but my real work is in crunch mode at the moment.

I think the fix actually does not address the full problem with the single line if statement. It certainly removes the rule confusion on multi-line if statements, but it does not address the resolver issue on single line if statements with empty then clauses. I think that is caused by me forgetting to put a null check into the method handling single line if statement contexts in the resolver when I made the one part optional. I believe that still needs to be added.

@tommy9
Copy link
Member Author

tommy9 commented Jan 27, 2024

Thanks, I didn't think to change the lack of null checking because the grammar fix should mean it there should never be an empty else clause and an empty then clause. However, who knows what odd code could end up taking that path, so I agree it is safest to add a check in. I'll update the pull request.

@rubberduck-vba-releasebot
Copy link
Member

Copy link
Contributor

@MDoerner MDoerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for dealing with this.

@retailcoder retailcoder merged commit cd1f206 into rubberduck-vba:next Jan 28, 2024
3 checks passed
@pflugs30
Copy link
Contributor

@retailcoder something is wrong with the release URL. When I try to download the updated build from the website for testing, I get a 404 on the redirect to Github.
image

The link with the 404 is:
https://github.com/rubberduck-vba/Rubberduck/releases/download/Prerelease-v2.5.9.6296/Rubberduck.Setup.2.5.9.6319-pre.exe

It should be:
https://github.com/rubberduck-vba/Rubberduck/releases/download/**Prerelease-v2.5.9.6319**/Rubberduck.Setup.2.5.9.6319-pre.exe

(without the asterisks, of course :-) )

@retailcoder
Copy link
Member

Argh, my bad - with the web API being down I'm manually inserting the records in the database... I messed that one up, will update over lunch (30-60 minutes)

@retailcoder
Copy link
Member

Fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants