You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** Check that the trees match and return the contents from the pattern holes.
70
94
* Return None if the trees do not match otherwise return Some of a tuple containing all the contents in the holes.
71
95
*
72
-
* @paramscrutinee The tree beeing matched
73
-
* @parampattern The pattern tree that the scrutinee should match. Contains `patternHole` holes.
74
-
* @param`the[Env]` Set of tuples containing pairs of symbols (s, p) where s defines a symbol in `scrutinee` which corresponds to symbol p in `pattern`.
75
-
* @return `None` if it did not match or `Some(tup: Tuple)` if it matched where `tup` contains the contents of the holes.
96
+
* @paramscrutinee The tree beeing matched
97
+
* @parampattern The pattern tree that the scrutinee should match. Contains `patternHole` holes.
98
+
* @param`the[Env]` Set of tuples containing pairs of symbols (s, p) where s defines a symbol in `scrutinee` which corresponds to symbol p in `pattern`.
99
+
* @return `None` if it did not match or `Some(tup: Tuple)` if it matched where `tup` contains the contents of the holes.
val (caseEnv, patternMatch) = scrutinee.pattern =%= pattern.pattern
259
283
withEnv(caseEnv) {
260
284
patternMatch &&
261
-
treeOptMatches(scrutinee.guard, pattern.guard) &&
262
-
scrutinee.rhs =#= pattern.rhs
285
+
treeOptMatches(scrutinee.guard, pattern.guard) &&
286
+
scrutinee.rhs =#= pattern.rhs
263
287
}
264
288
}
265
289
266
290
/** Check that the pattern trees match and return the contents from the pattern holes.
267
291
* Return a tuple with the new environment containing the bindings defined in this pattern and a matching.
268
292
* The matching is None if the pattern trees do not match otherwise return Some of a tuple containing all the contents in the holes.
269
293
*
270
-
* @paramscrutinee The pattern tree beeing matched
271
-
* @parampattern The pattern tree that the scrutinee should match. Contains `patternHole` holes.
272
-
* @param`the[Env]` Set of tuples containing pairs of symbols (s, p) where s defines a symbol in `scrutinee` which corresponds to symbol p in `pattern`.
273
-
* @return The new environment containing the bindings defined in this pattern tuppled with
274
-
* `None` if it did not match or `Some(tup: Tuple)` if it matched where `tup` contains the contents of the holes.
294
+
* @paramscrutinee The pattern tree beeing matched
295
+
* @parampattern The pattern tree that the scrutinee should match. Contains `patternHole` holes.
296
+
* @param`the[Env]` Set of tuples containing pairs of symbols (s, p) where s defines a symbol in `scrutinee` which corresponds to symbol p in `pattern`.
297
+
* @return The new environment containing the bindings defined in this pattern tuppled with
298
+
* `None` if it did not match or `Some(tup: Tuple)` if it matched where `tup` contains the contents of the holes.
0 commit comments