@@ -399811,7 +399811,7 @@ let pp_error fmt err =
399811
399811
-> "Uncurried function doesn't support optional arguments yet"
399812
399812
| Expect_opt_in_bs_return_to_opt
399813
399813
->
399814
- "@return directive *_to_opt expect return type to be \n\
399814
+ "% @return directive *_to_opt expect return type to be \n\
399815
399815
syntax wise `_ option` for safety"
399816
399816
399817
399817
| Not_supported_directive_in_bs_return
@@ -399820,7 +399820,7 @@ let pp_error fmt err =
399820
399820
| Illegal_attribute ->
399821
399821
"Illegal attributes"
399822
399822
| Canot_infer_arity_by_syntax
399823
- -> "Cannot infer the arity through the syntax, either [@uncurry n] or \n\
399823
+ -> "Cannot infer the arity through the syntax, either [% @uncurry n] or \n\
399824
399824
write it in arrow syntax "
399825
399825
| Inconsistent_arity (arity,n)
399826
399826
-> Printf.sprintf "Inconsistent arity %d vs %d" arity n
@@ -399831,7 +399831,7 @@ let pp_error fmt err =
399831
399831
->
399832
399832
"unsupported predicates"
399833
399833
| Conflict_bs_bs_this_bs_meth ->
399834
- "@this, @bs, @meth can not be applied at the same time"
399834
+ "% @this, % @bs, % @meth can not be applied at the same time"
399835
399835
| Duplicated_bs_deriving
399836
399836
-> "duplicate bs.deriving attribute"
399837
399837
| Conflict_attributes
@@ -399840,7 +399840,7 @@ let pp_error fmt err =
399840
399840
-> "expect string literal "
399841
399841
| Duplicated_bs_as
399842
399842
->
399843
- "duplicate @as "
399843
+ "duplicate % @as "
399844
399844
| Expect_int_literal
399845
399845
->
399846
399846
"expect int literal "
@@ -399857,20 +399857,20 @@ let pp_error fmt err =
399857
399857
"_ is not allowed in combination with external optional type"
399858
399858
| Invalid_bs_string_type
399859
399859
->
399860
- "Not a valid type for @string"
399860
+ "Not a valid type for % @string"
399861
399861
| Invalid_bs_int_type
399862
399862
->
399863
- "Not a valid type for @int"
399863
+ "Not a valid type for % @int"
399864
399864
| Invalid_bs_unwrap_type
399865
399865
->
399866
- "Not a valid type for @unwrap. Type must be an inline variant (closed), and\n\
399866
+ "Not a valid type for % @unwrap. Type must be an inline variant (closed), and\n\
399867
399867
each constructor must have an argument."
399868
399868
| Conflict_ffi_attribute str
399869
399869
->
399870
399870
"Conflicting FFI attributes found: " ^ str
399871
399871
| Bs_this_simple_pattern
399872
399872
->
399873
- "@this expect its pattern variable to be simple form")
399873
+ "% @this expect its pattern variable to be simple form")
399874
399874
399875
399875
type exn += Error of Location.t * error
399876
399876
@@ -402808,7 +402808,7 @@ let typ_mapper
402808
402808
| Uncurry attr , attrs ->
402809
402809
attrs, attr +> ty
402810
402810
| Method _, _
402811
- -> Location.raise_errorf ~loc "@get/set conflicts with @meth"
402811
+ -> Location.raise_errorf ~loc "% @get/set conflicts with % @meth"
402812
402812
| Meth_callback attr, attrs ->
402813
402813
attrs, attr +> ty
402814
402814
in
@@ -402820,7 +402820,7 @@ let typ_mapper
402820
402820
| Uncurry attr, attrs ->
402821
402821
attrs, attr +> ty
402822
402822
| Method _, _
402823
- -> Location.raise_errorf ~loc "@get/set conflicts with @meth"
402823
+ -> Location.raise_errorf ~loc "% @get/set conflicts with % @meth"
402824
402824
| Meth_callback attr, attrs ->
402825
402825
attrs, attr +> ty
402826
402826
in
@@ -403490,7 +403490,7 @@ let map_row_fields_into_strings ptyp_loc
403490
403490
let descr = if !has_bs_as then Some result else None in
403491
403491
match has_payload, descr with
403492
403492
| false, None ->
403493
- Location.prerr_warning ptyp_loc (Bs_ffi_warning "@string is redundant here, you can safely remove it");
403493
+ Location.prerr_warning ptyp_loc (Bs_ffi_warning "% @string is redundant here, you can safely remove it");
403494
403494
Nothing
403495
403495
| false , Some descr ->
403496
403496
External_arg_spec.Poly_var_string {descr }
@@ -404937,11 +404937,11 @@ let parse_external_attributes
404937
404937
| "bs.new" | "new" -> {st with new_name = name_from_payload_or_prim ~loc payload}
404938
404938
| "bs.set_index" | "set_index" ->
404939
404939
if String.length prim_name_check <> 0 then
404940
- Location.raise_errorf ~loc "@set_index this particular external's name needs to be a placeholder empty string";
404940
+ Location.raise_errorf ~loc "% @set_index this particular external's name needs to be a placeholder empty string";
404941
404941
{st with set_index = true}
404942
404942
| "bs.get_index" | "get_index" ->
404943
404943
if String.length prim_name_check <> 0 then
404944
- Location.raise_errorf ~loc "@get_index this particular external's name needs to be a placeholder empty string";
404944
+ Location.raise_errorf ~loc "% @get_index this particular external's name needs to be a placeholder empty string";
404945
404945
{st with get_index = true}
404946
404946
| "bs.obj" | "obj" -> {st with mk_obj = true}
404947
404947
| "bs.return" | "return" ->
@@ -405026,7 +405026,7 @@ let process_obj
405026
405026
TODO: better error message *)
405027
405027
} ->
405028
405028
if String.length prim_name <> 0 then
405029
- Location.raise_errorf ~loc "@ @obj expect external names to be empty string";
405029
+ Location.raise_errorf ~loc "% @obj expect external names to be empty string";
405030
405030
let arg_kinds, new_arg_types_ty, (result_types : Parsetree.object_field list) =
405031
405031
Ext_list.fold_right arg_types_ty ( [], [], [])
405032
405032
(fun param_type ( arg_labels, (arg_types : Ast_compatible.param_type list), result_types) ->
@@ -405072,15 +405072,15 @@ let process_obj
405072
405072
(Otag({Asttypes.txt = name; loc}, [], Ast_literal.type_string ~loc ()) :: result_types)
405073
405073
| Fn_uncurry_arity _ ->
405074
405074
Location.raise_errorf ~loc
405075
- "The combination of @@ obj, @ @uncurry is not supported yet"
405075
+ "The combination of %@ obj, % @uncurry is not supported yet"
405076
405076
| Extern_unit -> assert false
405077
405077
| Poly_var _
405078
405078
->
405079
405079
Location.raise_errorf ~loc
405080
- "@ @obj label %s does not support such arg type" name
405080
+ "% @obj label %s does not support such arg type" name
405081
405081
| Unwrap ->
405082
405082
Location.raise_errorf ~loc
405083
- "@@ obj label %s does not support @unwrap arguments" name
405083
+ "%@ obj label %s does not support % @unwrap arguments" name
405084
405084
end
405085
405085
| Optional name ->
405086
405086
let obj_arg_type = get_opt_arg_type ~nolabel:false ty in
@@ -405105,18 +405105,18 @@ let process_obj
405105
405105
(Otag ({Asttypes.txt = name; loc}, [], Ast_comb.to_undefined_type loc @@ Ast_literal.type_string ~loc ()) :: result_types)
405106
405106
| Arg_cst _
405107
405107
->
405108
- Location.raise_errorf ~loc "@ @as is not supported with optional yet"
405108
+ Location.raise_errorf ~loc "% @as is not supported with optional yet"
405109
405109
| Fn_uncurry_arity _ ->
405110
405110
Location.raise_errorf ~loc
405111
- "The combination of @@ obj, @ @uncurry is not supported yet"
405111
+ "The combination of %@ obj, % @uncurry is not supported yet"
405112
405112
| Extern_unit -> assert false
405113
405113
| Poly_var _
405114
405114
->
405115
405115
Location.raise_errorf ~loc
405116
- "@ @obj label %s does not support such arg type" name
405116
+ "% @obj label %s does not support such arg type" name
405117
405117
| Unwrap ->
405118
405118
Location.raise_errorf ~loc
405119
- "@@ obj label %s does not support @unwrap arguments" name
405119
+ "%@ obj label %s does not support % @unwrap arguments" name
405120
405120
end
405121
405121
in
405122
405122
new_arg_label::arg_labels,
@@ -405133,7 +405133,7 @@ let process_obj
405133
405133
in
405134
405134
Ast_compatible.mk_fn_type new_arg_types_ty result,
405135
405135
External_ffi_types.ffi_obj_create arg_kinds
405136
- | _ -> Location.raise_errorf ~loc "Attribute found that conflicts with @ @obj"
405136
+ | _ -> Location.raise_errorf ~loc "Attribute found that conflicts with % @obj"
405137
405137
405138
405138
405139
405139
let external_desc_of_non_obj
@@ -405166,9 +405166,9 @@ let external_desc_of_non_obj
405166
405166
if arg_type_specs_length = 3 then
405167
405167
Js_set_index {js_set_index_scopes = scopes}
405168
405168
else
405169
- Location.raise_errorf ~loc "Ill defined attribute @set_index (arity of 3)"
405169
+ Location.raise_errorf ~loc "Ill defined attribute % @set_index (arity of 3)"
405170
405170
| {set_index = true; _} ->
405171
- Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with @set_index")
405171
+ Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with % @set_index")
405172
405172
| {get_index = true;
405173
405173
val_name = `Nm_na;
405174
405174
external_module_name = None ;
@@ -405189,10 +405189,10 @@ let external_desc_of_non_obj
405189
405189
if arg_type_specs_length = 2 then
405190
405190
Js_get_index {js_get_index_scopes = scopes}
405191
405191
else Location.raise_errorf ~loc
405192
- "Ill defined attribute @get_index (arity expected 2 : while %d)" arg_type_specs_length
405192
+ "Ill defined attribute % @get_index (arity expected 2 : while %d)" arg_type_specs_length
405193
405193
405194
405194
| {get_index = true; _} ->
405195
- Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with @get_index")
405195
+ Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with % @get_index")
405196
405196
| {module_as_val = Some external_module_name ;
405197
405197
405198
405198
get_index = false;
@@ -405215,17 +405215,17 @@ let external_desc_of_non_obj
405215
405215
| [], `Nm_na, _ -> Js_module_as_var external_module_name
405216
405216
| _, `Nm_na, _ -> Js_module_as_fn {splice; external_module_name }
405217
405217
| _, #bundle_source, #bundle_source ->
405218
- Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with @ @module.")
405218
+ Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with % @module.")
405219
405219
405220
405220
| _, (`Nm_val _ | `Nm_external _) , `Nm_na
405221
405221
-> Js_module_as_class external_module_name
405222
405222
| _, `Nm_payload _ , `Nm_na
405223
405223
->
405224
405224
Location.raise_errorf ~loc
405225
- "Incorrect FFI attribute found: (@new should not carry a payload here)"
405225
+ "Incorrect FFI attribute found: (% @new should not carry a payload here)"
405226
405226
end
405227
405227
| {module_as_val = Some _; _} ->
405228
- Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with @ @module.")
405228
+ Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with % @module.")
405229
405229
| {call_name = (`Nm_val lazy name | `Nm_external name | `Nm_payload name) ;
405230
405230
splice;
405231
405231
scopes ;
@@ -405247,7 +405247,7 @@ let external_desc_of_non_obj
405247
405247
Js_call {splice; name; external_module_name; scopes }
405248
405248
| {call_name = #bundle_source ; _ }
405249
405249
->
405250
- Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with @val")
405250
+ Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with % @val")
405251
405251
| {val_name = (`Nm_val lazy name | `Nm_external name | `Nm_payload name);
405252
405252
external_module_name;
405253
405253
@@ -405274,7 +405274,7 @@ let external_desc_of_non_obj
405274
405274
Js_var { name; external_module_name; scopes}
405275
405275
| {val_name = #bundle_source ; _ }
405276
405276
->
405277
- Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with @val")
405277
+ Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with % @val")
405278
405278
405279
405279
| {splice ;
405280
405280
scopes ;
@@ -405324,16 +405324,16 @@ let external_desc_of_non_obj
405324
405324
begin match arg_type_specs with
405325
405325
| [] ->
405326
405326
Location.raise_errorf
405327
- ~loc "Ill defined attribute @send(the external needs to be a regular function call with at least one argument)"
405327
+ ~loc "Ill defined attribute % @send(the external needs to be a regular function call with at least one argument)"
405328
405328
| {arg_type = Arg_cst _ ; arg_label = _} :: _
405329
405329
->
405330
405330
Location.raise_errorf
405331
- ~loc "Ill defined attribute @send(first argument can't be const)"
405331
+ ~loc "Ill defined attribute % @send(first argument can't be const)"
405332
405332
| _ :: _ ->
405333
405333
Js_send {splice ; name; js_send_scopes = scopes ; pipe = false}
405334
405334
end
405335
405335
| {val_send = #bundle_source; _ }
405336
- -> Location.raise_errorf ~loc "You used a FFI attribute that can't be used with @send"
405336
+ -> Location.raise_errorf ~loc "You used a FFI attribute that can't be used with % @send"
405337
405337
| {val_send_pipe = Some _;
405338
405338
(* splice = (false as splice); *)
405339
405339
val_send = `Nm_na;
@@ -405358,7 +405358,7 @@ let external_desc_of_non_obj
405358
405358
pipe = true}
405359
405359
405360
405360
| {val_send_pipe = Some _ ; _}
405361
- -> Location.raise_errorf ~loc "conflict attributes found with [@ @bs.send.pipe]"
405361
+ -> Location.raise_errorf ~loc "conflict attributes found with [%@% @bs.send.pipe]"
405362
405362
405363
405363
| {new_name = (`Nm_val lazy name | `Nm_external name | `Nm_payload name);
405364
405364
external_module_name;
@@ -405379,7 +405379,7 @@ let external_desc_of_non_obj
405379
405379
}
405380
405380
-> Js_new {name; external_module_name; scopes}
405381
405381
| {new_name = #bundle_source ; _ } ->
405382
- Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with [@@ new] ")
405382
+ Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with %@ new")
405383
405383
| {set_name = (`Nm_val lazy name | `Nm_external name | `Nm_payload name);
405384
405384
val_name = `Nm_na ;
405385
405385
call_name = `Nm_na ;
@@ -405399,9 +405399,9 @@ let external_desc_of_non_obj
405399
405399
->
405400
405400
if arg_type_specs_length = 2 then
405401
405401
Js_set { js_set_scopes = scopes ; js_set_name = name}
405402
- else Location.raise_errorf ~loc "Ill defined attribute [@@ set] (two args required)"
405402
+ else Location.raise_errorf ~loc "Ill defined attribute %@ set (two args required)"
405403
405403
| {set_name = #bundle_source; _}
405404
- -> Location.raise_errorf ~loc "conflict attributes found with [@@ set] "
405404
+ -> Location.raise_errorf ~loc "conflict attributes found with %@ set"
405405
405405
| {get_name = (`Nm_val lazy name | `Nm_external name | `Nm_payload name);
405406
405406
405407
405407
val_name = `Nm_na ;
@@ -405423,9 +405423,9 @@ let external_desc_of_non_obj
405423
405423
if arg_type_specs_length = 1 then
405424
405424
Js_get { js_get_name = name; js_get_scopes = scopes }
405425
405425
else
405426
- Location.raise_errorf ~loc "Ill defined attribute [@@ bs.get] (only one argument)"
405426
+ Location.raise_errorf ~loc "Ill defined attribute %@ bs.get (only one argument)"
405427
405427
| {get_name = #bundle_source; _}
405428
- -> Location.raise_errorf ~loc "Attribute found that conflicts with [@@ bs.get] "
405428
+ -> Location.raise_errorf ~loc "Attribute found that conflicts with %@ bs.get"
405429
405429
405430
405430
| {get_name = `Nm_na;
405431
405431
val_name = `Nm_na ;
@@ -405461,7 +405461,7 @@ let handle_attributes
405461
405461
*)
405462
405462
if has_bs_uncurry type_annotation.ptyp_attributes then
405463
405463
Location.raise_errorf
405464
- ~loc "@uncurry can not be applied to the whole definition";
405464
+ ~loc "% @uncurry can not be applied to the whole definition";
405465
405465
let prim_name_or_pval_name =
405466
405466
if String.length prim_name = 0 then
405467
405467
`Nm_val (lazy (Location.prerr_warning loc (Bs_fragile_external pval_name); pval_name))
@@ -405472,7 +405472,7 @@ let handle_attributes
405472
405472
if has_bs_uncurry result_type.ptyp_attributes then
405473
405473
Location.raise_errorf
405474
405474
~loc:result_type.ptyp_loc
405475
- "@uncurry can not be applied to tailed position";
405475
+ "% @uncurry can not be applied to tailed position";
405476
405476
let no_arguments = arg_types_ty = [] in
405477
405477
let unused_attrs, external_desc =
405478
405478
parse_external_attributes no_arguments
@@ -405490,7 +405490,7 @@ let handle_attributes
405490
405490
let arg_type = refine_arg_type ~nolabel:true obj in
405491
405491
begin match arg_type with
405492
405492
| Arg_cst _ ->
405493
- Location.raise_errorf ~loc:obj.ptyp_loc "[ @as] is not supported in @send type "
405493
+ Location.raise_errorf ~loc:obj.ptyp_loc "% @as is not supported in % @send type "
405494
405494
| _ ->
405495
405495
(* more error checking *)
405496
405496
[{arg_label = Arg_empty; arg_type}],
@@ -405508,17 +405508,17 @@ let handle_attributes
405508
405508
if i = 0 && splice then
405509
405509
begin match arg_label with
405510
405510
| Optional _ ->
405511
- Location.raise_errorf ~loc "@ @variadic expect the last type to be a non optional"
405511
+ Location.raise_errorf ~loc "% @variadic expect the last type to be a non optional"
405512
405512
| Labelled _ | Nolabel
405513
405513
->
405514
405514
if ty.ptyp_desc = Ptyp_any then
405515
- Location.raise_errorf ~loc "@ @variadic expect the last type to be an array";
405515
+ Location.raise_errorf ~loc "% @variadic expect the last type to be an array";
405516
405516
if spec_of_ptyp true ty <> Nothing then
405517
- Location.raise_errorf ~loc "@ @variadic expect the last type to be an array";
405517
+ Location.raise_errorf ~loc "% @variadic expect the last type to be an array";
405518
405518
match ty.ptyp_desc with
405519
405519
| Ptyp_constr({txt = Lident "array"; _}, [_])
405520
405520
-> ()
405521
- | _ -> Location.raise_errorf ~loc "@ @variadic expect the last type to be an array";
405521
+ | _ -> Location.raise_errorf ~loc "% @variadic expect the last type to be an array";
405522
405522
end ;
405523
405523
let (arg_label : External_arg_spec.label_noname), arg_type, new_arg_types =
405524
405524
match arg_label with
@@ -405529,7 +405529,7 @@ let handle_attributes
405529
405529
(* ?x:([`x of int ] [@string]) does not make sense *)
405530
405530
Location.raise_errorf
405531
405531
~loc
405532
- "@string does not work with optional when it has arities in label %s" s
405532
+ "% @string does not work with optional when it has arities in label %s" s
405533
405533
| _ ->
405534
405534
Arg_optional, arg_type,
405535
405535
param_type :: arg_types end
@@ -407897,7 +407897,7 @@ let expr_mapper (self : mapper) (e : Parsetree.expression) =
407897
407897
pexp_desc = Ast_uncurry_gen.to_uncurry_fn e.pexp_loc self label pat body ;
407898
407898
pexp_attributes}
407899
407899
| Method _ , _
407900
- -> Location.raise_errorf ~loc:e.pexp_loc "@meth is not supported in function expression"
407900
+ -> Location.raise_errorf ~loc:e.pexp_loc "% @meth is not supported in function expression"
407901
407901
| Meth_callback _, pexp_attributes
407902
407902
->
407903
407903
(** FIXME: does it make sense to have a label for [this] ? *)
@@ -407923,7 +407923,7 @@ let expr_mapper (self : mapper) (e : Parsetree.expression) =
407923
407923
}
407924
407924
| Some e ->
407925
407925
Location.raise_errorf
407926
- ~loc:e.pexp_loc "`with` construct is not supported in obj ")
407926
+ ~loc:e.pexp_loc "`with` construct is not supported in js obj ")
407927
407927
else
407928
407928
default_expr_mapper self e
407929
407929
| Pexp_object {pcstr_self; pcstr_fields} ->
0 commit comments