File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -27,14 +27,23 @@ let handle_extension e (self : Bs_ast_mapper.mapper)
27
27
(({txt; loc} , payload ) : Parsetree. extension ) =
28
28
match txt with
29
29
| "todo" ->
30
- Location. prerr_warning e.Parsetree. pexp_loc
31
- (Bs_todo
32
- (match Ast_payload. is_single_string payload with
33
- | Some (s , _ ) -> Some s
34
- | None -> None ));
30
+ let todo_message =
31
+ match Ast_payload. is_single_string payload with
32
+ | Some (s , _ ) -> Some s
33
+ | None -> None
34
+ in
35
+ Location. prerr_warning e.Parsetree. pexp_loc (Bs_todo todo_message);
35
36
Exp. apply ~loc
36
- (Exp. ident ~loc {txt = Longident. parse " Obj.magic" ; loc})
37
- [(Nolabel , Exp. construct ~loc {txt = Longident. Lident " ()" ; loc} None )]
37
+ (Exp. ident ~loc {txt = Longident. parse " failwith" ; loc})
38
+ [
39
+ ( Nolabel ,
40
+ Exp. constant ~loc
41
+ (Pconst_string
42
+ ( (match todo_message with
43
+ | None -> " todo"
44
+ | Some msg -> msg),
45
+ None )) );
46
+ ]
38
47
| "ffi" -> Ast_exp_handle_external. handle_ffi ~loc ~payload
39
48
| "bs.raw" | "raw" ->
40
49
Ast_exp_handle_external. handle_raw ~kind: Raw_exp loc payload
You can’t perform that action at this time.
0 commit comments