18 #define impl_afw_value_optional_release NULL
19 #define impl_afw_value_get_reference NULL
23 #define impl_afw_value_get_evaluated_meta \
24 afw_value_internal_get_evaluated_meta_default
26 #define impl_afw_value_get_evaluated_metas \
27 afw_value_internal_get_evaluated_metas_default
30 #define AFW_IMPLEMENTATION_ID "call"
31 #define AFW_IMPLEMENTATION_INF_SPECIFIER AFW_DEFINE_CONST_DATA
32 #define AFW_IMPLEMENTATION_INF_LABEL afw_value_call_inf
38 impl_call_script_function(
60 "impl_call_script_function() must be called with script function",
68 "impl_call_script_function() expects lambda value",
86 for (parameter_number = 1, params = l->parameters, arg = argv + 1;
87 parameter_number <= l->count;
88 parameter_number++, params++, arg++)
91 if ((*params)->is_rest) {
94 if (argc >= l->count) {
95 rest_argc = argc - l->count + 1;
107 rest_argv, rest_argc, p, xctx);
114 if (parameter_number <= argc) {
116 *arg, parameter_number,
122 if ((*params)->default_value) {
123 value = (*params)->default_value;
125 else if (!(*params)->is_optional) {
134 cur->name = &afw_s_a_empty_string;
141 parameter_number = 1,
142 params = l->parameters;
143 parameter_number <= l->count;
148 cur->name = (*params)->name;
183 "afw_value_call_create() argv[0] must be specified",
194 contextual, argc, argv, p, xctx);
199 result->function_value = argv[0];
201 result->args.
argc = argc;
202 result->args.
argv = argv;
227 xctx->error->
contextual =
self->args.contextual;
256 result = impl_call_script_function(function_value,
257 self->args.argc, self->args.argv, p, xctx);
265 result = afw_value_call_built_in_function(
266 self->args.contextual,
268 self->args.argc, self->args.argv, p, xctx);
276 self->args.argc, self->args.argv, p, xctx);
293 impl_afw_value_get_data_type(
304 impl_afw_value_get_evaluated_data_type(
316 impl_afw_value_get_evaluated_data_type_parameter(
329 impl_afw_value_produce_compiler_listing(
337 afw_value_compiler_listing_begin_value(writer, instance,
338 self->args.contextual, xctx);
343 afw_value_compiler_listing_call_args(writer, &self->args, xctx);
356 impl_afw_value_decompile(
380 impl_afw_value_get_info(
390 info->value_inf_id = &instance->inf->rti.implementation_id;
391 info->contextual =
self->args.contextual;
AFW_DEFINE(const afw_object_t *)
Adaptive Framework Core Internal.
Interface afw_interface implementation declares.
afw_value_create_list(const afw_list_t *internal, const afw_pool_t *p, afw_xctx_t *xctx)
Create function for unmanaged data type list value.
apr_size_t afw_size_t
size_t.
#define AFW_SIZE_T_FMT
Format string specifier used for afw_size_t.
#define AFW_FINALLY
Always executed regardless of error.
#define AFW_ENDTRY
Ends an AFW try block.
#define AFW_TRY
Begin an AFW TRY block.
#define AFW_THROW_ERROR_FZ(code, xctx, format_z,...)
Macro used to set error and 0 rv in xctx and throw it.
#define AFW_THROW_ERROR_Z(code, message_z, xctx)
Macro used to set error and 0 rv in xctx and throw it.
afw_function_evaluate_parameter_with_type(const afw_value_t *value, afw_size_t parameter_number, const afw_value_type_t *type, const afw_pool_t *p, afw_xctx_t *xctx)
Evaluate a parameter with dataTypeParameter.
const afw_list_t * afw_list_const_create_array_of_values(const afw_value_t *const *values, afw_size_t count, const afw_pool_t *p, afw_xctx_t *xctx)
Create an immutable list from an array of values.
#define afw_memory_clear(to)
Clear preallocated memory for sizeof(*(to)).
#define afw_pool_calloc_type(instance, type, xctx)
Macro to allocate cleared memory to hold type in pool.
const afw_value_t * impl_afw_value_optional_evaluate(const afw_value_t *instance, const afw_pool_t *p, afw_xctx_t *xctx)
#define afw_value_is_function_thunk(A_VALUE)
Macro to determine if value is a function thunk.
#define afw_value_evaluate(value, p, xctx)
Evaluate value if needed using specific pool.
afw_value_call_inf
Value call inf.
#define afw_value_is_function_definition(A_VALUE)
Macro to determine if value is a function definition.
afw_value_call_create(const afw_compile_value_contextual_t *contextual, afw_size_t argc, const afw_value_t *const *argv, const afw_pool_t *p, afw_xctx_t *xctx)
Create function for call value.
const afw_value_t * afw_value_call_built_in_function_create(const afw_compile_value_contextual_t *contextual, afw_size_t argc, const afw_value_t *const *argv, const afw_pool_t *p, afw_xctx_t *xctx)
Create function for call_built_in_function value.
#define afw_value_is_script_function(A_VALUE)
Macro to determine if value is lambda definition.
#define afw_writer_increment_indent(instance, xctx)
Call method increment_indent of interface afw_writer.
#define afw_writer_write_eol(instance, xctx)
Call method write_eol of interface afw_writer.
#define afw_writer_decrement_indent(instance, xctx)
Call method decrement_indent of interface afw_writer.
#define afw_writer_write_z(writer, s_z, xctx)
Call afw_writer_write() with zero terminated string.
int afw_xctx_begin_stack_frame(afw_xctx_t *xctx)
Begin stack frame.
#define afw_xctx_evaluation_stack_push_value(VALUE, xctx)
Push VALUE onto execution stack.
#define afw_xctx_evaluation_stack_pop_value(xctx)
Pop top VALUE off execution stack.
void afw_xctx_end_stack_frame(int top, afw_xctx_t *xctx)
Set stack top.
Contextual information provided in some values.
Interface afw_data_type public struct.
const afw_compile_value_contextual_t * contextual
Contextual information or NULL.
Interface afw_list public struct.
Typedef for name/value pair.
Interface afw_pool public struct.
NFC normalized UTF-8 string.
const afw_value_t *const * argv
const afw_compile_value_contextual_t * contextual
Struct for function value.
Struct for function thunk value.
Filled in by afw_value get_info method.
Interface afw_value public struct.
Struct for script function parameter.
Interface afw_writer public struct.
Interface afw_xctx public struct.