Skip to content

Commit 69af0f0

Browse files
committed
snapshot
1 parent 6b860c2 commit 69af0f0

File tree

4 files changed

+154
-154
lines changed

4 files changed

+154
-154
lines changed

lib/4.06.1/unstable/all_ounit_tests.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8104,7 +8104,7 @@ let suites =
81048104
= ""
81058105
[@@bs.send.pipe:int]
81068106
[@@bs.splice]|}|] in
8107-
OUnit.assert_bool __LOC__ (Ext_string.contain_substring v_output.stderr "bs.splice")
8107+
OUnit.assert_bool __LOC__ (Ext_string.contain_substring v_output.stderr "variadic")
81088108
end;
81098109
__LOC__ >:: begin fun _ ->
81108110
let v_output = perform_bsc [|"-bs-eval"; {|external
@@ -8113,7 +8113,7 @@ let suites =
81138113
= ""
81148114
[@@bs.send.pipe:int]
81158115
[@@bs.splice] |}|] in
8116-
OUnit.assert_bool __LOC__ (Ext_string.contain_substring v_output.stderr "bs.splice")
8116+
OUnit.assert_bool __LOC__ (Ext_string.contain_substring v_output.stderr "variadic")
81178117
end;
81188118

81198119
__LOC__ >:: begin fun _ ->

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -399811,7 +399811,7 @@ let pp_error fmt err =
399811399811
-> "Uncurried function doesn't support optional arguments yet"
399812399812
| Expect_opt_in_bs_return_to_opt
399813399813
->
399814-
"@return directive *_to_opt expect return type to be \n\
399814+
"%@return directive *_to_opt expect return type to be \n\
399815399815
syntax wise `_ option` for safety"
399816399816

399817399817
| Not_supported_directive_in_bs_return
@@ -399820,7 +399820,7 @@ let pp_error fmt err =
399820399820
| Illegal_attribute ->
399821399821
"Illegal attributes"
399822399822
| 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\
399824399824
write it in arrow syntax "
399825399825
| Inconsistent_arity (arity,n)
399826399826
-> Printf.sprintf "Inconsistent arity %d vs %d" arity n
@@ -399831,7 +399831,7 @@ let pp_error fmt err =
399831399831
->
399832399832
"unsupported predicates"
399833399833
| 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"
399835399835
| Duplicated_bs_deriving
399836399836
-> "duplicate bs.deriving attribute"
399837399837
| Conflict_attributes
@@ -399840,7 +399840,7 @@ let pp_error fmt err =
399840399840
-> "expect string literal "
399841399841
| Duplicated_bs_as
399842399842
->
399843-
"duplicate @as "
399843+
"duplicate %@as "
399844399844
| Expect_int_literal
399845399845
->
399846399846
"expect int literal "
@@ -399857,20 +399857,20 @@ let pp_error fmt err =
399857399857
"_ is not allowed in combination with external optional type"
399858399858
| Invalid_bs_string_type
399859399859
->
399860-
"Not a valid type for @string"
399860+
"Not a valid type for %@string"
399861399861
| Invalid_bs_int_type
399862399862
->
399863-
"Not a valid type for @int"
399863+
"Not a valid type for %@int"
399864399864
| Invalid_bs_unwrap_type
399865399865
->
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\
399867399867
each constructor must have an argument."
399868399868
| Conflict_ffi_attribute str
399869399869
->
399870399870
"Conflicting FFI attributes found: " ^ str
399871399871
| Bs_this_simple_pattern
399872399872
->
399873-
"@this expect its pattern variable to be simple form")
399873+
"%@this expect its pattern variable to be simple form")
399874399874

399875399875
type exn += Error of Location.t * error
399876399876

@@ -402808,7 +402808,7 @@ let typ_mapper
402808402808
| Uncurry attr , attrs ->
402809402809
attrs, attr +> ty
402810402810
| Method _, _
402811-
-> Location.raise_errorf ~loc "@get/set conflicts with @meth"
402811+
-> Location.raise_errorf ~loc "%@get/set conflicts with %@meth"
402812402812
| Meth_callback attr, attrs ->
402813402813
attrs, attr +> ty
402814402814
in
@@ -402820,7 +402820,7 @@ let typ_mapper
402820402820
| Uncurry attr, attrs ->
402821402821
attrs, attr +> ty
402822402822
| Method _, _
402823-
-> Location.raise_errorf ~loc "@get/set conflicts with @meth"
402823+
-> Location.raise_errorf ~loc "%@get/set conflicts with %@meth"
402824402824
| Meth_callback attr, attrs ->
402825402825
attrs, attr +> ty
402826402826
in
@@ -403490,7 +403490,7 @@ let map_row_fields_into_strings ptyp_loc
403490403490
let descr = if !has_bs_as then Some result else None in
403491403491
match has_payload, descr with
403492403492
| 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");
403494403494
Nothing
403495403495
| false , Some descr ->
403496403496
External_arg_spec.Poly_var_string {descr }
@@ -404937,11 +404937,11 @@ let parse_external_attributes
404937404937
| "bs.new" | "new" -> {st with new_name = name_from_payload_or_prim ~loc payload}
404938404938
| "bs.set_index" | "set_index" ->
404939404939
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";
404941404941
{st with set_index = true}
404942404942
| "bs.get_index" | "get_index" ->
404943404943
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";
404945404945
{st with get_index = true}
404946404946
| "bs.obj" | "obj" -> {st with mk_obj = true}
404947404947
| "bs.return" | "return" ->
@@ -405026,7 +405026,7 @@ let process_obj
405026405026
TODO: better error message *)
405027405027
} ->
405028405028
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";
405030405030
let arg_kinds, new_arg_types_ty, (result_types : Parsetree.object_field list) =
405031405031
Ext_list.fold_right arg_types_ty ( [], [], [])
405032405032
(fun param_type ( arg_labels, (arg_types : Ast_compatible.param_type list), result_types) ->
@@ -405072,15 +405072,15 @@ let process_obj
405072405072
(Otag({Asttypes.txt = name; loc}, [], Ast_literal.type_string ~loc ()) :: result_types)
405073405073
| Fn_uncurry_arity _ ->
405074405074
Location.raise_errorf ~loc
405075-
"The combination of @@obj, @@uncurry is not supported yet"
405075+
"The combination of %@obj, %@uncurry is not supported yet"
405076405076
| Extern_unit -> assert false
405077405077
| Poly_var _
405078405078
->
405079405079
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
405081405081
| Unwrap ->
405082405082
Location.raise_errorf ~loc
405083-
"@@obj label %s does not support @unwrap arguments" name
405083+
"%@obj label %s does not support %@unwrap arguments" name
405084405084
end
405085405085
| Optional name ->
405086405086
let obj_arg_type = get_opt_arg_type ~nolabel:false ty in
@@ -405105,18 +405105,18 @@ let process_obj
405105405105
(Otag ({Asttypes.txt = name; loc}, [], Ast_comb.to_undefined_type loc @@ Ast_literal.type_string ~loc ()) :: result_types)
405106405106
| Arg_cst _
405107405107
->
405108-
Location.raise_errorf ~loc "@@as is not supported with optional yet"
405108+
Location.raise_errorf ~loc "%@as is not supported with optional yet"
405109405109
| Fn_uncurry_arity _ ->
405110405110
Location.raise_errorf ~loc
405111-
"The combination of @@obj, @@uncurry is not supported yet"
405111+
"The combination of %@obj, %@uncurry is not supported yet"
405112405112
| Extern_unit -> assert false
405113405113
| Poly_var _
405114405114
->
405115405115
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
405117405117
| Unwrap ->
405118405118
Location.raise_errorf ~loc
405119-
"@@obj label %s does not support @unwrap arguments" name
405119+
"%@obj label %s does not support %@unwrap arguments" name
405120405120
end
405121405121
in
405122405122
new_arg_label::arg_labels,
@@ -405133,7 +405133,7 @@ let process_obj
405133405133
in
405134405134
Ast_compatible.mk_fn_type new_arg_types_ty result,
405135405135
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"
405137405137

405138405138

405139405139
let external_desc_of_non_obj
@@ -405166,9 +405166,9 @@ let external_desc_of_non_obj
405166405166
if arg_type_specs_length = 3 then
405167405167
Js_set_index {js_set_index_scopes = scopes}
405168405168
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)"
405170405170
| {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")
405172405172
| {get_index = true;
405173405173
val_name = `Nm_na;
405174405174
external_module_name = None ;
@@ -405189,10 +405189,10 @@ let external_desc_of_non_obj
405189405189
if arg_type_specs_length = 2 then
405190405190
Js_get_index {js_get_index_scopes = scopes}
405191405191
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
405193405193

405194405194
| {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")
405196405196
| {module_as_val = Some external_module_name ;
405197405197

405198405198
get_index = false;
@@ -405215,17 +405215,17 @@ let external_desc_of_non_obj
405215405215
| [], `Nm_na, _ -> Js_module_as_var external_module_name
405216405216
| _, `Nm_na, _ -> Js_module_as_fn {splice; external_module_name }
405217405217
| _, #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.")
405219405219

405220405220
| _, (`Nm_val _ | `Nm_external _) , `Nm_na
405221405221
-> Js_module_as_class external_module_name
405222405222
| _, `Nm_payload _ , `Nm_na
405223405223
->
405224405224
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)"
405226405226
end
405227405227
| {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.")
405229405229
| {call_name = (`Nm_val lazy name | `Nm_external name | `Nm_payload name) ;
405230405230
splice;
405231405231
scopes ;
@@ -405247,7 +405247,7 @@ let external_desc_of_non_obj
405247405247
Js_call {splice; name; external_module_name; scopes }
405248405248
| {call_name = #bundle_source ; _ }
405249405249
->
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")
405251405251
| {val_name = (`Nm_val lazy name | `Nm_external name | `Nm_payload name);
405252405252
external_module_name;
405253405253

@@ -405274,7 +405274,7 @@ let external_desc_of_non_obj
405274405274
Js_var { name; external_module_name; scopes}
405275405275
| {val_name = #bundle_source ; _ }
405276405276
->
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")
405278405278

405279405279
| {splice ;
405280405280
scopes ;
@@ -405324,16 +405324,16 @@ let external_desc_of_non_obj
405324405324
begin match arg_type_specs with
405325405325
| [] ->
405326405326
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)"
405328405328
| {arg_type = Arg_cst _ ; arg_label = _} :: _
405329405329
->
405330405330
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)"
405332405332
| _ :: _ ->
405333405333
Js_send {splice ; name; js_send_scopes = scopes ; pipe = false}
405334405334
end
405335405335
| {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"
405337405337
| {val_send_pipe = Some _;
405338405338
(* splice = (false as splice); *)
405339405339
val_send = `Nm_na;
@@ -405358,7 +405358,7 @@ let external_desc_of_non_obj
405358405358
pipe = true}
405359405359

405360405360
| {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]"
405362405362

405363405363
| {new_name = (`Nm_val lazy name | `Nm_external name | `Nm_payload name);
405364405364
external_module_name;
@@ -405379,7 +405379,7 @@ let external_desc_of_non_obj
405379405379
}
405380405380
-> Js_new {name; external_module_name; scopes}
405381405381
| {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")
405383405383
| {set_name = (`Nm_val lazy name | `Nm_external name | `Nm_payload name);
405384405384
val_name = `Nm_na ;
405385405385
call_name = `Nm_na ;
@@ -405399,9 +405399,9 @@ let external_desc_of_non_obj
405399405399
->
405400405400
if arg_type_specs_length = 2 then
405401405401
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)"
405403405403
| {set_name = #bundle_source; _}
405404-
-> Location.raise_errorf ~loc "conflict attributes found with [@@set]"
405404+
-> Location.raise_errorf ~loc "conflict attributes found with %@set"
405405405405
| {get_name = (`Nm_val lazy name | `Nm_external name | `Nm_payload name);
405406405406

405407405407
val_name = `Nm_na ;
@@ -405423,9 +405423,9 @@ let external_desc_of_non_obj
405423405423
if arg_type_specs_length = 1 then
405424405424
Js_get { js_get_name = name; js_get_scopes = scopes }
405425405425
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)"
405427405427
| {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"
405429405429

405430405430
| {get_name = `Nm_na;
405431405431
val_name = `Nm_na ;
@@ -405461,7 +405461,7 @@ let handle_attributes
405461405461
*)
405462405462
if has_bs_uncurry type_annotation.ptyp_attributes then
405463405463
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";
405465405465
let prim_name_or_pval_name =
405466405466
if String.length prim_name = 0 then
405467405467
`Nm_val (lazy (Location.prerr_warning loc (Bs_fragile_external pval_name); pval_name))
@@ -405472,7 +405472,7 @@ let handle_attributes
405472405472
if has_bs_uncurry result_type.ptyp_attributes then
405473405473
Location.raise_errorf
405474405474
~loc:result_type.ptyp_loc
405475-
"@uncurry can not be applied to tailed position";
405475+
"%@uncurry can not be applied to tailed position";
405476405476
let no_arguments = arg_types_ty = [] in
405477405477
let unused_attrs, external_desc =
405478405478
parse_external_attributes no_arguments
@@ -405490,7 +405490,7 @@ let handle_attributes
405490405490
let arg_type = refine_arg_type ~nolabel:true obj in
405491405491
begin match arg_type with
405492405492
| 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 "
405494405494
| _ ->
405495405495
(* more error checking *)
405496405496
[{arg_label = Arg_empty; arg_type}],
@@ -405508,17 +405508,17 @@ let handle_attributes
405508405508
if i = 0 && splice then
405509405509
begin match arg_label with
405510405510
| 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"
405512405512
| Labelled _ | Nolabel
405513405513
->
405514405514
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";
405516405516
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";
405518405518
match ty.ptyp_desc with
405519405519
| Ptyp_constr({txt = Lident "array"; _}, [_])
405520405520
-> ()
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";
405522405522
end ;
405523405523
let (arg_label : External_arg_spec.label_noname), arg_type, new_arg_types =
405524405524
match arg_label with
@@ -405529,7 +405529,7 @@ let handle_attributes
405529405529
(* ?x:([`x of int ] [@string]) does not make sense *)
405530405530
Location.raise_errorf
405531405531
~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
405533405533
| _ ->
405534405534
Arg_optional, arg_type,
405535405535
param_type :: arg_types end
@@ -407897,7 +407897,7 @@ let expr_mapper (self : mapper) (e : Parsetree.expression) =
407897407897
pexp_desc = Ast_uncurry_gen.to_uncurry_fn e.pexp_loc self label pat body ;
407898407898
pexp_attributes}
407899407899
| 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"
407901407901
| Meth_callback _, pexp_attributes
407902407902
->
407903407903
(** FIXME: does it make sense to have a label for [this] ? *)
@@ -407923,7 +407923,7 @@ let expr_mapper (self : mapper) (e : Parsetree.expression) =
407923407923
}
407924407924
| Some e ->
407925407925
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 ")
407927407927
else
407928407928
default_expr_mapper self e
407929407929
| Pexp_object {pcstr_self; pcstr_fields} ->

0 commit comments

Comments
 (0)