summaryrefslogtreecommitdiff
path: root/src/rewriter.ml
diff options
context:
space:
mode:
authorAlasdair Armstrong2018-07-26 16:30:59 +0100
committerAlasdair Armstrong2018-07-26 16:53:07 +0100
commit4861ebb08ccd3e13af19b9c12f2164b66a5d2bb0 (patch)
treebdd294f3d0efc80ab7833c192c72ed7f345169e5 /src/rewriter.ml
parent92373cfb9dd6a9a3d450a315d462378b7de20a71 (diff)
Some tweaks to not and or patterns
- Fix ambiguities in parser.mly - Ensure that no new identifiers are bound in or-patterns and not-patterns, by adding a no_bindings switch to the environment. These patterns shouldn't generate any bogus flow typing constraints because we just pass through the original environment without adding any possible constraints (although this does mean we don't get any flow typing from negated numeric literals right now, which is a TODO). - Reformat some code to match surrounding code. - Add a typechecking test case for not patterns - Add a typechecking test case for or patterns At least at the front end everything should work now, but we need to do a little bit more to rewrite these patterns away for lem etc.
Diffstat (limited to 'src/rewriter.ml')
-rw-r--r--src/rewriter.ml2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rewriter.ml b/src/rewriter.ml
index 1fa3bc67..f072f91f 100644
--- a/src/rewriter.ml
+++ b/src/rewriter.ml
@@ -292,7 +292,7 @@ let rewrite_pat rewriters (P_aux (pat,(l,annot)) as orig_pat) =
rewrap (P_vector ps)
| P_lit _ | P_wild | P_id _ | P_var _ -> rewrap pat
| P_or(pat1, pat2) -> rewrap (P_or(rewrite pat1, rewrite pat2))
- | P_not(pat) -> rewrap (P_not(rewrite pat))
+ | P_not(pat) -> rewrap (P_not(rewrite pat))
| P_as(pat,id) -> rewrap (P_as(rewrite pat, id))
| P_typ(typ,pat) -> rewrap (P_typ(typ, rewrite pat))
| P_app(id ,pats) -> rewrap (P_app(id, List.map rewrite pats))