Skip to content

Commit

Permalink
feat(backend/fstar): patterns: allow shallow POr
Browse files Browse the repository at this point in the history
Fixes #462
  • Loading branch information
W95Psp committed Jan 29, 2024
1 parent 7a7fcf9 commit 327729d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions engine/backends/fstar/fstar_backend.ml
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,10 @@ struct
| GConst e -> pexpr e
| GLifetime _ -> .

and ppat (p : pat) =
and ppat (p : pat) = ppat' true p

and ppat' (shallow : bool) (p : pat) =
let ppat = ppat' false in
match p.p with
| PWild -> F.wild
| PAscription { typ; pat } ->
Expand All @@ -345,8 +348,7 @@ struct
typ = _ (* we skip type annot here *);
} ->
F.pat @@ F.AST.PatVar (plocal_ident var, None, [])
| POr { subpats } ->
Error.unimplemented p.span ~details:"ppat:Disjuntive patterns"
| POr { subpats } -> F.pat @@ F.AST.PatOr (List.map ~f:ppat subpats)
| PArray { args } -> F.pat @@ F.AST.PatList (List.map ~f:ppat args)
| PConstruct { name = `TupleCons 0; args = [] } ->
F.pat @@ F.AST.PatConst F.Const.Const_unit
Expand Down

0 comments on commit 327729d

Please sign in to comment.