@@ -1901,6 +1901,11 @@ pub type TypedClauseGuard = ClauseGuard<Arc<Type>, EcoString>;
1901
1901
1902
1902
#[ derive( Debug , Clone , PartialEq , Eq ) ]
1903
1903
pub enum ClauseGuard < Type , RecordTag > {
1904
+ Block {
1905
+ location : SrcSpan ,
1906
+ value : Box < ClauseGuard < Type , RecordTag > > ,
1907
+ } ,
1908
+
1904
1909
Equals {
1905
1910
location : SrcSpan ,
1906
1911
left : Box < Self > ,
@@ -2094,7 +2099,8 @@ impl<A, B> ClauseGuard<A, B> {
2094
2099
| ClauseGuard :: DivFloat { location, .. }
2095
2100
| ClauseGuard :: RemainderInt { location, .. }
2096
2101
| ClauseGuard :: LtEqFloat { location, .. }
2097
- | ClauseGuard :: ModuleSelect { location, .. } => * location,
2102
+ | ClauseGuard :: ModuleSelect { location, .. }
2103
+ | ClauseGuard :: Block { location, .. } => * location,
2098
2104
ClauseGuard :: FieldAccess {
2099
2105
label_location,
2100
2106
container,
@@ -2140,7 +2146,8 @@ impl<A, B> ClauseGuard<A, B> {
2140
2146
| ClauseGuard :: Not { .. }
2141
2147
| ClauseGuard :: TupleIndex { .. }
2142
2148
| ClauseGuard :: FieldAccess { .. }
2143
- | ClauseGuard :: ModuleSelect { .. } => None ,
2149
+ | ClauseGuard :: ModuleSelect { .. }
2150
+ | ClauseGuard :: Block { .. } => None ,
2144
2151
}
2145
2152
}
2146
2153
}
@@ -2153,6 +2160,7 @@ impl TypedClauseGuard {
2153
2160
ClauseGuard :: FieldAccess { type_, .. } => type_. clone ( ) ,
2154
2161
ClauseGuard :: ModuleSelect { type_, .. } => type_. clone ( ) ,
2155
2162
ClauseGuard :: Constant ( constant) => constant. type_ ( ) ,
2163
+ ClauseGuard :: Block { value, .. } => value. type_ ( ) ,
2156
2164
2157
2165
ClauseGuard :: AddInt { .. }
2158
2166
| ClauseGuard :: SubInt { .. }
@@ -2185,6 +2193,7 @@ impl TypedClauseGuard {
2185
2193
match self {
2186
2194
ClauseGuard :: Var { name, .. } => im:: hashset![ name] ,
2187
2195
2196
+ ClauseGuard :: Block { value, .. } => value. referenced_variables ( ) ,
2188
2197
ClauseGuard :: Not { expression, .. } => expression. referenced_variables ( ) ,
2189
2198
ClauseGuard :: TupleIndex { tuple, .. } => tuple. referenced_variables ( ) ,
2190
2199
ClauseGuard :: FieldAccess { container, .. } => container. referenced_variables ( ) ,
0 commit comments