OCaml wire format DSL with EverParse 3D output for verified parsers
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(lint): replace Printf/Format with Fmt in block and bpsec

+6 -7
+3 -4
lib/c/wire_c.ml
··· 32 32 let ep_dir = find_everparse_dir () in 33 33 let src = Filename.concat ep_dir "src/3d/EverParseEndianness.h" in 34 34 if Sys.file_exists src then copy_file ~src ~dst 35 - else failwith (Fmt.str "Cannot find EverParseEndianness.h at %s" src) 35 + else Fmt.failwith "Cannot find EverParseEndianness.h at %s" src 36 36 end 37 37 38 38 let has_3d_exe () = Sys.command "command -v 3d.exe > /dev/null 2>&1" = 0 ··· 43 43 let f = s.name ^ ".3d" in 44 44 let cmd = Fmt.str "cd %s && 3d.exe --batch %s" outdir f in 45 45 let ret = Sys.command cmd in 46 - if ret <> 0 then 47 - failwith (Fmt.str "EverParse failed on %s with code %d" f ret)) 46 + if ret <> 0 then Fmt.failwith "EverParse failed on %s with code %d" f ret) 48 47 schemas; 49 48 copy_everparse_endianness ~outdir 50 49 ··· 81 80 close_in ic; 82 81 match !result with 83 82 | Some fn -> fn 84 - | None -> failwith (Fmt.str "Could not find Validate function in %s" header) 83 + | None -> Fmt.failwith "Could not find Validate function in %s" header 85 84 86 85 let generate_test ~outdir schemas = 87 86 let oc = open_out (Filename.concat outdir "test.c") in
+2 -2
lib/diff-gen/diff_gen.ml
··· 26 26 schema_dir 27 27 in 28 28 let ret = Sys.command cmd in 29 - if ret <> 0 then failwith (Fmt.str "EverParse failed with code %d" ret) 29 + if ret <> 0 then Fmt.failwith "EverParse failed with code %d" ret 30 30 31 31 (** {1 Extracting EverParse-generated Function Names} 32 32 ··· 62 62 close_in ic; 63 63 match !result with 64 64 | Some fn -> fn 65 - | None -> failwith (Fmt.str "Could not find Validate function in %s" header) 65 + | None -> Fmt.failwith "Could not find Validate function in %s" header 66 66 67 67 (** {1 Code Generation} *) 68 68
+1 -1
test/diff/gen_c.ml
··· 299 299 schema_dir 300 300 in 301 301 let ret = Sys.command cmd in 302 - if ret <> 0 then failwith (Fmt.str "EverParse failed with code %d" ret) 302 + if ret <> 0 then Fmt.failwith "EverParse failed with code %d" ret 303 303 304 304 (* ---- Main ---- *) 305 305