File tree Expand file tree Collapse file tree 4 files changed +12
-1
lines changed Expand file tree Collapse file tree 4 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ type error =
2828 | Bs_cyclic_depends of string list
2929 | Bs_duplicated_module of string * string
3030 | Bs_package_not_found of string
31+ | Bs_main_not_exist of string
32+
3133exception Error of error
3234
3335let error err = raise (Error err)
@@ -44,6 +46,10 @@ let report_error ppf = function
4446 | Bs_duplicated_module (a,b)
4547 ->
4648 Format. fprintf ppf " The build system does not support two files with same names yet %s, %s" a b
49+ | Bs_main_not_exist main
50+ ->
51+ Format. fprintf ppf " File %s not found " main
52+
4753 | Bs_package_not_found package
4854 ->
4955 Format. fprintf ppf " Pacage %s not found or %s/lib/ocaml does not exist"
Original file line number Diff line number Diff line change @@ -27,4 +27,6 @@ type error =
2727 | Bs_cyclic_depends of string list
2828 | Bs_duplicated_module of string * string
2929 | Bs_package_not_found of string
30+ | Bs_main_not_exist of string
31+
3032val error : error -> 'a
Original file line number Diff line number Diff line change @@ -67,6 +67,9 @@ let batch_compile ppf files main_file =
6767 Ocaml_parse. lazy_parse_implementation
6868 Ocaml_parse. lazy_parse_interface
6969 main_file in
70+ if Queue. is_empty result then
71+ Bs_exception. error (Bs_main_not_exist main_file)
72+ ;
7073 process_result ppf main_file ast_table result
7174 else 0
7275
Original file line number Diff line number Diff line change 3232BS_FLAGS = $(BS_COMMON_FLAGS ) -bs-package-output lib/js
3333endif
3434
35- COMPFLAGS += $(BS_FLAGS ) -I ../stdlib -nostdlib -nopervasives -open Pervasives -unsafe -w -40
35+ COMPFLAGS += $(BS_FLAGS ) -I ../stdlib -nostdlib -nopervasives -open Pervasives -unsafe -w -40-49
3636
3737
3838
You can’t perform that action at this time.
0 commit comments