diff --git a/Makefile b/Makefile index 73ffd4a..93cd1db 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,4 @@ apigen.native: $(wildcard *.ml* src/*.ml*) - dune clean dune build --profile release cp _build/default/apigen.exe $@ @@ -7,7 +6,6 @@ test/%/dune: test/dune-template Makefile sed -e 's/%NAME%/$*/g' $< > $@ check: $(patsubst %,%dune,$(dir $(wildcard test/*/*.api.h))) - dune clean BISECT_ENABLE=yes dune runtest coverage: check diff --git a/apigen.ml b/apigen.ml index 91364a3..b72932f 100644 --- a/apigen.ml +++ b/apigen.ml @@ -27,5 +27,8 @@ let () = | [|_; "-ast" ; input|] -> main input Ast | [|_; "-api" ; input|] -> main input Api | _ -> print_endline "Usage: apigen " - with Failure (msg) -> - print_endline ("Failure: " ^ msg) + with + | Failure msg -> print_endline ("Failure: " ^ msg) + | ApiLexer.Lexing_error (start_p, token) -> + let error = ApiPasses.format_lex_error start_p token in + print_endline ("Lexing_error: " ^ error)