-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Cleanup parsed AST #5464
Merged
Merged
Cleanup parsed AST #5464
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tritao
added
code quality
compiler: frontend
Everything to do with type checking, control flow analysis, and everything between parsing and IRgen
compiler: parser
Everything to do with the parser
labels
Jan 12, 2024
tritao
force-pushed
the
cleanup-parsed-ast
branch
from
January 22, 2024 10:28
b635722
to
40554c3
Compare
tritao
force-pushed
the
cleanup-parsed-ast
branch
6 times, most recently
from
January 31, 2024 23:33
f65cfa6
to
ad10adb
Compare
tritao
force-pushed
the
cleanup-parsed-ast
branch
from
February 1, 2024 00:00
ad10adb
to
16ffc5a
Compare
tritao
force-pushed
the
cleanup-parsed-ast
branch
from
February 1, 2024 00:33
16ffc5a
to
970534d
Compare
IGI-111
previously approved these changes
Feb 1, 2024
xunilrj
reviewed
Feb 1, 2024
xunilrj
reviewed
Feb 1, 2024
xunilrj
reviewed
Feb 1, 2024
xunilrj
previously approved these changes
Feb 1, 2024
tritao
force-pushed
the
cleanup-parsed-ast
branch
from
February 1, 2024 17:09
eda3c33
to
6eadefb
Compare
ironcev
requested changes
Feb 2, 2024
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.
Great to have this cleanup! And also that it revealed the type checking issue.
Just a small detail, there are three clone()
operations in code, of expressions and nodes that are not necessary and are simple to remove.
...-core/src/semantic_analysis/ast_node/expression/match_expression/typed/typed_match_branch.rs
Outdated
Show resolved
Hide resolved
...-core/src/semantic_analysis/ast_node/expression/match_expression/typed/typed_match_branch.rs
Outdated
Show resolved
Hide resolved
Good catch, cleaned up those unnecessary clones. |
ironcev
approved these changes
Feb 2, 2024
esdrubal
approved these changes
Feb 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
code quality
compiler: frontend
Everything to do with type checking, control flow analysis, and everything between parsing and IRgen
compiler: parser
Everything to do with the parser
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This cleans up the parsed AST by doing the following:
Remove unused ReturnStatement.
Refactor Declaration::ImplicitReturnExpression as Expression::ImplicitReturn
During the work on debugging some issues around this refactoring, an issue with the way that implicit/explicit return type-checking is currently realized was found, which is reported in #5518.
Currently this was "worked-around" by special casing the type-checking of implicit returns, just like it is currently done, but we should look into unifying this behaviour in a later PR (I've been looking into it, but all hell breaks loose after an initial try).
Checklist
Breaking*
orNew Feature
labels where relevant.