Commit Graph

9 Commits

Author SHA1 Message Date
GearsDatapacks
1fc6dbc32b Change expr_trailing_brace to an exhaustive match to force new expression kinds to specify whether they contain a brace
Add inline const and other possible curly brace expressions to expr_trailing_brace

Add tests for `}` before `else` in `let...else` error

Change to explicit cases for expressions with optional values when being checked for trailing braces

Add tests for more complex cases of `}` before `else` in `let..else` statement

Move other possible `}` cases into separate arm and add FIXME for future reference
2023-12-14 18:11:18 +00:00
Oli Scherer
621494382d Add gen blocks to ast and do some broken ast lowering 2023-10-27 13:05:48 +00:00
Matthew Jasper
333388fd3c Move let expression checking to parsing
There was an incomplete version of the check in parsing and a second
version in AST validation. This meant that some, but not all, invalid
uses were allowed inside macros/disabled cfgs. It also means that later
passes have a hard time knowing when the let expression is in a valid
location, sometimes causing ICEs.

- Add a field to ExprKind::Let in AST/HIR to mark whether it's in a
  valid location.
- Suppress later errors and MIR construction for invalid let
  expressions.
2023-09-11 15:51:18 +00:00
clubby789
0932452fa4 Remove box_syntax from AST and use in tools 2023-03-12 13:19:46 +00:00
Gary Guo
171b7d62ad Make inline const block ExprWithBlock 2022-12-01 17:54:50 +00:00
Nicholas Nethercote
6b7ca2fcf2 Box ExprKind::{Closure,MethodCall}, and QSelf in expressions, types, and patterns. 2022-11-17 13:45:59 +11:00
Cameron Steffen
29bc94ff0d Handle let-else initializer edge case errors 2021-08-30 20:18:42 -05:00
Matthias Krüger
d12a358673 use matches!() macro in more places 2020-12-24 13:35:12 +01:00
mark
9e5f7d5631 mv compiler to compiler/ 2020-08-30 18:45:07 +03:00