diff --git a/src/kernel_services/ast_queries/file.ml b/src/kernel_services/ast_queries/file.ml index 379b8bf9935c950ccb61dfa9d23a6e38b7b46b7a..b15088fa8d6fd1432063c008cc1e9690028bccf3 100644 --- a/src/kernel_services/ast_queries/file.ml +++ b/src/kernel_services/ast_queries/file.ml @@ -606,14 +606,14 @@ let parse_cabs cpp_command = function if not (Sys.file_exists (f:>string)) then Kernel.abort "file %a does not exist." Filepath.Normalized.pretty f; - try - Kernel.feedback "Parsing %a (external front-end)" - Datatype.Filepath.pretty f; - Hashtbl.find check_suffixes suf (f:>string) - with Not_found -> - Kernel.abort - "could not find a suitable plugin for parsing %a." - Filepath.Normalized.pretty f + Kernel.feedback "Parsing %a (external front-end)" + Datatype.Filepath.pretty f; + (match Hashtbl.find_opt check_suffixes suf with + | Some parse -> parse (f:>string) + | None -> + Kernel.abort + "could not find a suitable plugin for parsing %a." + Filepath.Normalized.pretty f) let to_cil_cabs cpp_cmds_and_args f = try