diff options
author | Son Ho | 2023-03-07 08:51:22 +0100 |
---|---|---|
committer | Son HO | 2023-06-04 21:44:33 +0200 |
commit | 73b95970460fb7d8c90e2ea97fa6457d7850af07 (patch) | |
tree | 6fca33592c9aa380280ba3095867743fde5d74c3 | |
parent | feb60683216a6d9193d6353605560c6c80a1ab41 (diff) |
Add more checks in Driver.ml
Diffstat (limited to '')
-rw-r--r-- | compiler/Driver.ml | 8 | ||||
-rw-r--r-- | compiler/SymbolicToPure.ml | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/compiler/Driver.ml b/compiler/Driver.ml index 1dbd611a..149e2aad 100644 --- a/compiler/Driver.ml +++ b/compiler/Driver.ml @@ -134,7 +134,7 @@ let () = match !opt_backend with | Some b -> backend := b | None -> - print_string "Backend not specified (use the `-backend` argument)\n"; + log#error "Backend not specified (use the `-backend` argument)"; fail () in @@ -151,7 +151,11 @@ let () = decompose_nested_let_patterns := true | Lean -> (* The Lean backend is experimental: print a warning *) - log#lwarning (lazy "The Lean backend is experimental") + log#lwarning (lazy "The Lean backend is experimental"); + (* We don't support fuel for the Lean backend *) + if !use_fuel then ( + log#error "The Lean backend doesn't support the -use-fuel option"; + fail ()) in (* Retrieve and check the filename *) diff --git a/compiler/SymbolicToPure.ml b/compiler/SymbolicToPure.ml index f357f33b..2c103177 100644 --- a/compiler/SymbolicToPure.ml +++ b/compiler/SymbolicToPure.ml @@ -2616,7 +2616,8 @@ let wrap_in_match_fuel (fuel0 : VarId.id) (fuel : VarId.id) (body : texpression) let match_e = Switch (fuel0, Match [ fail_branch; success_branch ]) in { e = match_e; ty = match_ty } | Lean -> - failwith "Not handling fuel in Lean" + (* We should have checked the command line arguments before *) + raise (Failure "Unexpected") let translate_fun_decl (ctx : bs_ctx) (body : S.expression option) : fun_decl = (* Translate *) |