25
25
26
26
(* * Browser is not set via command line only for internal use *)
27
27
28
+ type jsx_version = Jsx_v3 | Jsx_v4 | NotSelected
29
+ type jsx_module = React
30
+ type jsx_mode = Classic | Automatic
31
+
28
32
let no_version_header = ref false
29
33
let cross_module_inline = ref false
30
34
let diagnose = ref false
31
35
32
36
let get_diagnose () =
33
37
! diagnose
34
38
35
- # 34 " common/js_config.pp.ml"
39
+ # 38 " common/js_config.pp.ml"
36
40
|| Sys. getenv_opt " RES_DEBUG_FILE" <> None
37
41
38
- # 37 " common/js_config.pp.ml"
42
+ # 41 " common/js_config.pp.ml"
39
43
(* let (//) = Filename.concat *)
40
44
41
45
(* let get_packages_info () = !packages_info *)
@@ -51,15 +55,41 @@ let cmi_only = ref false
51
55
let cmj_only = ref false
52
56
let force_cmi = ref false
53
57
let force_cmj = ref false
54
- let jsx_version = ref ( - 1 )
55
- let jsx_module = ref " react "
56
- let jsx_mode = ref " classic "
58
+ let jsx_version = ref NotSelected
59
+ let jsx_module = ref React
60
+ let jsx_mode = ref Classic
57
61
let js_stdout = ref true
58
62
let all_module_aliases = ref false
59
63
let no_stdlib = ref false
60
64
let no_export = ref false
61
65
let as_ppx = ref false
62
66
67
+ let int_of_jsx_version = function
68
+ | Jsx_v3 -> 3
69
+ | Jsx_v4 -> 4
70
+ | NotSelected -> - 1
71
+
72
+ let string_of_jsx_module = function
73
+ | React -> " react"
74
+
75
+ let string_of_jsx_mode = function
76
+ | Classic -> " classic"
77
+ | Automatic -> " automatic"
78
+
79
+ let jsx_version_of_int = function
80
+ | 3 -> Jsx_v3
81
+ | 4 -> Jsx_v4
82
+ | _ -> NotSelected
83
+
84
+ let jsx_module_of_string = function
85
+ | "react" -> React
86
+ | _ -> React
87
+
88
+ let jsx_mode_of_string = function
89
+ | "classic" -> Classic
90
+ | "automatic" -> Automatic
91
+ | _ -> Classic
92
+
63
93
(* option to config `@rescript/std`*)
64
94
let customize_runtime : string option ref = ref None
65
95
let as_pp = ref false
0 commit comments