-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Description ## Problem Part of #5668 ## Summary Both ExpressionKind and StatementKind will be exposed as `Expr` (as discussed with Jake). So `Expr::as_block` will return the block statements as a list of expressions. There's also the thing that some of these statements might be `Semi` (well, all except maybe the last one) and having to explicitly unwrap that with `as_semi` might be tedious or bug-prone, so instead that's unwrapped automatically when you call any of the `as_...` methods, but then there's an `has_semicolon` on `Expr` to know if it has a semicolon. ## Additional Context There's just those two methods in this PR because I wanted to validate this approach. Next I'll add more `as_...` methods but for StatementKind. ## Documentation Check one: - [ ] No documentation needed. - [ ] Documentation included in this PR. - [x] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist - [x] I have tested the changes locally. - [x] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
- Loading branch information
Showing
4 changed files
with
160 additions
and
51 deletions.
There are no files selected for viewing
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
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
Oops, something went wrong.