mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
Add fx var to can's Call
This commit is contained in:
parent
3cef756559
commit
e8d7820f34
14 changed files with 52 additions and 10 deletions
|
@ -91,6 +91,7 @@ fn wrap_in_decode_custom_decode_with(
|
|||
Loc::at_zero(decode_with_var),
|
||||
this_decode_with_clos_var,
|
||||
this_decode_with_ret_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
let decode_with_call = Call(
|
||||
decode_with_fn,
|
||||
|
@ -198,6 +199,7 @@ fn wrap_in_decode_custom_decode_with(
|
|||
Loc::at_zero(decode_custom_var),
|
||||
this_decode_custom_clos_var,
|
||||
this_decode_custom_ret_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
let decode_custom_call = Call(
|
||||
decode_custom_fn,
|
||||
|
|
|
@ -78,6 +78,7 @@ pub(crate) fn decoder(env: &mut Env<'_>, _def_symbol: Symbol) -> (Expr, Variable
|
|||
Loc::at_zero(decode_list_member),
|
||||
this_decode_list_clos_var,
|
||||
this_decode_list_ret_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
let decode_list_call = Call(
|
||||
|
|
|
@ -130,6 +130,7 @@ pub(crate) fn decoder(
|
|||
)),
|
||||
decode_record_lambda_set,
|
||||
record_decoder_var,
|
||||
Variable::PURE,
|
||||
)),
|
||||
vec![
|
||||
(initial_state_var, Loc::at_zero(initial_state)),
|
||||
|
@ -422,6 +423,7 @@ fn custom_decoder(env: &mut Env<'_>, args: DecodingFieldArgs) -> (Variable, Expr
|
|||
Loc::at_zero(Expr::Var(Symbol::DECODE_CUSTOM, this_decode_custom_var)),
|
||||
decode_custom_closure_var,
|
||||
decode_custom_ret_var,
|
||||
Variable::PURE,
|
||||
)),
|
||||
vec![(this_custom_callback_var, Loc::at_zero(custom_callback))],
|
||||
CalledVia::Space,
|
||||
|
@ -1328,6 +1330,7 @@ pub(super) fn decode_with(
|
|||
Loc::at_zero(Expr::Var(Symbol::DECODE_DECODE_WITH, this_decode_with_var)),
|
||||
lambda_set_var,
|
||||
rec_var,
|
||||
Variable::PURE,
|
||||
)),
|
||||
vec![
|
||||
(Variable::LIST_U8, Loc::at_zero(bytes_arg_expr)),
|
||||
|
|
|
@ -120,6 +120,7 @@ pub(crate) fn decoder(env: &mut Env, _def_symbol: Symbol, arity: u32) -> (Expr,
|
|||
)),
|
||||
decode_record_lambda_set,
|
||||
tuple_decoder_var,
|
||||
Variable::PURE,
|
||||
)),
|
||||
vec![
|
||||
(state_var, Loc::at_zero(initial_state)),
|
||||
|
@ -490,6 +491,7 @@ fn step_elem(
|
|||
Loc::at_zero(Expr::Var(Symbol::DECODE_DECODE_WITH, this_decode_with_var)),
|
||||
lambda_set_var,
|
||||
rec_var,
|
||||
Variable::PURE,
|
||||
)),
|
||||
vec![
|
||||
(
|
||||
|
@ -598,6 +600,7 @@ fn step_elem(
|
|||
Loc::at_zero(Expr::Var(Symbol::DECODE_CUSTOM, this_decode_custom_var)),
|
||||
decode_custom_closure_var,
|
||||
decode_custom_ret_var,
|
||||
Variable::PURE,
|
||||
)),
|
||||
vec![(this_custom_callback_var, Loc::at_zero(custom_callback))],
|
||||
CalledVia::Space,
|
||||
|
|
|
@ -146,6 +146,7 @@ fn to_encoder_list(env: &mut Env<'_>, fn_name: Symbol) -> (Expr, Variable) {
|
|||
Loc::at_zero(to_encoder_var),
|
||||
to_encoder_clos_var,
|
||||
elem_encoder_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
// toEncoder elem
|
||||
|
@ -231,6 +232,7 @@ fn to_encoder_list(env: &mut Env<'_>, fn_name: Symbol) -> (Expr, Variable) {
|
|||
Loc::at_zero(encode_list),
|
||||
this_encode_list_clos_var,
|
||||
this_list_encoder_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
// Encode.list lst to_elem_encoder
|
||||
|
@ -370,6 +372,7 @@ fn to_encoder_record(
|
|||
Loc::at_zero(to_encoder_var),
|
||||
to_encoder_clos_var,
|
||||
encoder_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
// toEncoder rcd.a
|
||||
|
@ -451,6 +454,7 @@ fn to_encoder_record(
|
|||
Loc::at_zero(encode_record_var),
|
||||
encode_record_clos_var,
|
||||
encoder_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
// Encode.record [ { key: .., value: .. }, .. ]
|
||||
|
@ -574,6 +578,7 @@ fn to_encoder_tuple(
|
|||
Loc::at_zero(to_encoder_var),
|
||||
to_encoder_clos_var,
|
||||
encoder_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
// toEncoder tup.0
|
||||
|
@ -635,6 +640,7 @@ fn to_encoder_tuple(
|
|||
Loc::at_zero(encode_tuple_var),
|
||||
encode_tuple_clos_var,
|
||||
encoder_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
// Encode.tuple [ { key: .., value: .. }, .. ]
|
||||
|
@ -776,6 +782,7 @@ fn to_encoder_tag_union(
|
|||
Loc::at_zero(to_encoder_var),
|
||||
to_encoder_clos_var,
|
||||
encoder_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
// toEncoder rcd.a
|
||||
|
@ -835,6 +842,7 @@ fn to_encoder_tag_union(
|
|||
Loc::at_zero(encode_tag_var),
|
||||
this_encode_tag_clos_var,
|
||||
this_encoder_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
// Encode.tag "A" [ Encode.toEncoder v1, Encode.toEncoder v2 ]
|
||||
|
@ -991,6 +999,7 @@ fn wrap_in_encode_custom(
|
|||
Loc::at_zero(Var(Symbol::ENCODE_APPEND_WITH, this_append_with_fn_var)),
|
||||
this_append_with_clos_var,
|
||||
Variable::LIST_U8,
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
// Encode.appendWith bytes encoder fmt
|
||||
|
@ -1084,6 +1093,7 @@ fn wrap_in_encode_custom(
|
|||
Loc::at_zero(Var(Symbol::ENCODE_CUSTOM, this_custom_fn_var)),
|
||||
this_custom_clos_var, // -[clos]->
|
||||
this_custom_encoder_var, // t' ~ Encoder fmt
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
// Encode.custom \bytes, fmt -> Encode.appendWith bytes encoder fmt
|
||||
|
|
|
@ -489,6 +489,7 @@ fn call_hash_ability_member(
|
|||
Loc::at_zero(hash_fn_head),
|
||||
this_hash_clos_var,
|
||||
this_out_hasher_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
let hash_arguments = vec![
|
||||
|
|
|
@ -152,6 +152,7 @@ fn to_inspector_list(env: &mut Env<'_>, fn_name: Symbol) -> (Expr, Variable) {
|
|||
Loc::at_zero(to_inspector_var),
|
||||
to_inspector_clos_var,
|
||||
elem_inspector_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
// toInspector elem
|
||||
|
@ -238,6 +239,7 @@ fn to_inspector_list(env: &mut Env<'_>, fn_name: Symbol) -> (Expr, Variable) {
|
|||
Loc::at_zero(inspect_list),
|
||||
this_inspect_list_clos_var,
|
||||
this_list_inspector_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
// Inspect.list lst to_elem_inspector
|
||||
|
@ -382,6 +384,7 @@ fn to_inspector_record(
|
|||
Loc::at_zero(to_inspector_var),
|
||||
to_inspector_clos_var,
|
||||
inspector_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
// toInspector rcd.a
|
||||
|
@ -463,6 +466,7 @@ fn to_inspector_record(
|
|||
Loc::at_zero(inspect_record_var),
|
||||
inspect_record_clos_var,
|
||||
inspector_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
// Inspect.record [ { key: .., value: .. }, .. ]
|
||||
|
@ -587,6 +591,7 @@ fn to_inspector_tuple(
|
|||
Loc::at_zero(to_inspector_var),
|
||||
to_inspector_clos_var,
|
||||
inspector_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
// toInspector tup.0
|
||||
|
@ -648,6 +653,7 @@ fn to_inspector_tuple(
|
|||
Loc::at_zero(inspect_tuple_var),
|
||||
inspect_tuple_clos_var,
|
||||
inspector_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
// Inspect.tuple [ { key: .., value: .. }, .. ]
|
||||
|
@ -789,6 +795,7 @@ fn to_inspector_tag_union(
|
|||
Loc::at_zero(to_inspector_var),
|
||||
to_inspector_clos_var,
|
||||
inspector_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
// toInspector rcd.a
|
||||
|
@ -852,6 +859,7 @@ fn to_inspector_tag_union(
|
|||
Loc::at_zero(inspect_tag_var),
|
||||
this_inspect_tag_clos_var,
|
||||
this_inspector_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
// Inspect.tag "A" [ Inspect.toInspector v1, Inspect.toInspector v2 ]
|
||||
|
@ -997,6 +1005,7 @@ fn wrap_in_inspect_custom(
|
|||
Loc::at_zero(Var(Symbol::INSPECT_APPLY, this_apply_fn_var)),
|
||||
this_apply_clos_var,
|
||||
fmt_var,
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
// Inspect.apply inspector fmt
|
||||
|
@ -1081,6 +1090,7 @@ fn wrap_in_inspect_custom(
|
|||
Loc::at_zero(Var(Symbol::INSPECT_CUSTOM, this_custom_fn_var)),
|
||||
this_custom_clos_var, // -[clos]->
|
||||
this_custom_inspector_var, // t' ~ Inspector fmt
|
||||
Variable::PURE,
|
||||
));
|
||||
|
||||
// Inspect.custom \fmt -> Inspect.apply inspector fmt
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue