@@ -17334,7 +17334,7 @@ module Js_config : sig
17334
17334
* along with this program; if not, write to the Free Software
17335
17335
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
17336
17336
17337
- type jsx_version = Jsx_v3 | Jsx_v4 | NotSelected
17337
+ type jsx_version = Jsx_v3 | Jsx_v4
17338
17338
type jsx_module = React
17339
17339
type jsx_mode = Classic | Automatic
17340
17340
@@ -17389,7 +17389,7 @@ val force_cmi : bool ref
17389
17389
17390
17390
val force_cmj : bool ref
17391
17391
17392
- val jsx_version : jsx_version ref
17392
+ val jsx_version : jsx_version option ref
17393
17393
17394
17394
val jsx_module: jsx_module ref
17395
17395
@@ -17411,7 +17411,7 @@ val string_of_jsx_module : jsx_module -> string
17411
17411
17412
17412
val string_of_jsx_mode : jsx_mode -> string
17413
17413
17414
- val jsx_version_of_int : int -> jsx_version
17414
+ val jsx_version_of_int : int -> jsx_version option
17415
17415
17416
17416
val jsx_module_of_string : string -> jsx_module
17417
17417
@@ -17453,7 +17453,7 @@ end = struct
17453
17453
17454
17454
(** Browser is not set via command line only for internal use *)
17455
17455
17456
- type jsx_version = Jsx_v3 | Jsx_v4 | NotSelected
17456
+ type jsx_version = Jsx_v3 | Jsx_v4
17457
17457
type jsx_module = React
17458
17458
type jsx_mode = Classic | Automatic
17459
17459
@@ -17480,7 +17480,7 @@ let cmi_only = ref false
17480
17480
let cmj_only = ref false
17481
17481
let force_cmi = ref false
17482
17482
let force_cmj = ref false
17483
- let jsx_version = ref NotSelected
17483
+ let jsx_version = ref None
17484
17484
let jsx_module = ref React
17485
17485
let jsx_mode = ref Classic
17486
17486
let js_stdout = ref true
@@ -17492,7 +17492,6 @@ let as_ppx = ref false
17492
17492
let int_of_jsx_version = function
17493
17493
| Jsx_v3 -> 3
17494
17494
| Jsx_v4 -> 4
17495
- | NotSelected -> -1
17496
17495
17497
17496
let string_of_jsx_module = function
17498
17497
| React -> "react"
@@ -17502,9 +17501,9 @@ let string_of_jsx_mode = function
17502
17501
| Automatic -> "automatic"
17503
17502
17504
17503
let jsx_version_of_int = function
17505
- | 3 -> Jsx_v3
17506
- | 4 -> Jsx_v4
17507
- | _ -> NotSelected
17504
+ | 3 -> Some Jsx_v3
17505
+ | 4 -> Some Jsx_v4
17506
+ | _ -> None
17508
17507
17509
17508
let jsx_module_of_string = function
17510
17509
| "react" -> React
@@ -275557,10 +275556,10 @@ let rewrite_signature (ast : Parsetree.signature) : Parsetree.signature =
275557
275556
Ast_config.iter_on_bs_config_sigi ast;
275558
275557
let ast =
275559
275558
match !Js_config.jsx_version with
275560
- | NotSelected -> ast
275561
- | _ ->
275559
+ | None -> ast
275560
+ | Some jsxVersion ->
275562
275561
let open Js_config in
275563
- let jsxVersion = int_of_jsx_version !jsx_version in
275562
+ let jsxVersion = int_of_jsx_version jsxVersion in
275564
275563
let jsxModule = string_of_jsx_module !jsx_module in
275565
275564
let jsxMode = string_of_jsx_mode !jsx_mode in
275566
275565
Reactjs_jsx_ppx.rewrite_signature ~jsxVersion ~jsxModule ~jsxMode ast
@@ -275577,10 +275576,10 @@ let rewrite_implementation (ast : Parsetree.structure) : Parsetree.structure =
275577
275576
Ast_config.iter_on_bs_config_stru ast;
275578
275577
let ast =
275579
275578
match !Js_config.jsx_version with
275580
- | NotSelected -> ast
275581
- | _ ->
275579
+ | None -> ast
275580
+ | Some jsxVersion ->
275582
275581
let open Js_config in
275583
- let jsxVersion = int_of_jsx_version !jsx_version in
275582
+ let jsxVersion = int_of_jsx_version jsxVersion in
275584
275583
let jsxModule = string_of_jsx_module !jsx_module in
275585
275584
let jsxMode = string_of_jsx_mode !jsx_mode in
275586
275585
Reactjs_jsx_ppx.rewrite_implementation ~jsxVersion ~jsxModule ~jsxMode
@@ -294208,7 +294207,7 @@ module Compile = struct
294208
294207
let env = Res_compmisc.initial_env () in (* Question ?? *)
294209
294208
(* let finalenv = ref Env.empty in *)
294210
294209
let types_signature = ref [] in
294211
- Js_config.jsx_version := Js_config.Jsx_v3; (* default *)
294210
+ Js_config.jsx_version := Some Js_config.Jsx_v3; (* default *)
294212
294211
let ast = impl (str) in
294213
294212
let ast = Ppx_entry.rewrite_implementation ast in
294214
294213
let typed_tree =
0 commit comments