83 afw_function_evaluate_whitespace_parameter(
111 result = &afw_s_a_tab;
118 " must be a string no longer than 10 or an "
119 "integer between 0 and 10",
185 NULL, NULL, x->
p, x->
xctx);
188 listing = afw_function_evaluate_whitespace_parameter(x, 2);
251 afw_compile_type_json,
252 NULL, NULL, x->
p, x->
xctx);
255 listing = afw_function_evaluate_whitespace_parameter(x, 2);
317 afw_compile_type_relaxed_json,
318 NULL, NULL, x->
p, x->
xctx);
321 listing = afw_function_evaluate_whitespace_parameter(x, 2);
379 whitespace = afw_function_evaluate_whitespace_parameter(x, 2);
383 afw_compile_type_hybrid,
384 NULL, NULL, x->
p, x->
xctx);
435 whitespace = afw_function_evaluate_whitespace_parameter(x, 2);
493 afw_compile_type_expression_tuple,
494 NULL, NULL, x->
p, x->
xctx);
613 for (success =
false; !success;) {
622 if (failures > limit->internal) {
632 "Evaluation produced an undefined result", xctx);
693 "Evaluation produced an undefined result", xctx);
759 "replacer parameter is not implemented yet",
765 whitespace = afw_function_evaluate_whitespace_parameter(x, 3);
843 &afw_s_id, &id->internal, x->
xctx);
845 &afw_s_description, &description->internal, xctx);
847 &afw_s_expression, &expression->internal, xctx);
857 afw_compile_type_expression,
858 NULL, NULL, x->
p, x->
xctx);
970 &afw_s_id, &id->internal, xctx);
972 &afw_s_description, &description->internal, xctx);
974 &afw_s_expression, &expression->internal, xctx);
984 afw_compile_type_expression_tuple,
985 NULL, NULL, x->
p, xctx);
989 compiled, x->
argv[5], x->
p, xctx);
1098 &afw_s_id, &id->internal, xctx);
1100 &afw_s_description, &description->internal, xctx);
1102 &afw_s_hybrid, &hybrid->internal, xctx);
1112 afw_compile_type_hybrid,
1113 NULL, NULL, x->
p, xctx);
1117 compiled, x->
argv[5], x->
p, xctx);
1225 &afw_s_id, &id->internal, xctx);
1227 &afw_s_description, &description->internal, xctx);
1229 &afw_s_expression, &expression->internal, xctx);
1239 afw_compile_type_script,
1240 NULL, NULL, x->
p, xctx);
1244 compiled, x->
argv[5], x->
p, xctx);
1352 &afw_s_id, &id->internal, xctx);
1354 &afw_s_description, &description->internal, xctx);
1356 &afw_s_template, &template->internal, xctx);
1366 afw_compile_type_template,
1367 NULL, NULL, x->
p, xctx);
1371 compiled, x->
argv[5], x->
p, xctx);
1478 &afw_s_id, &id->internal, xctx);
1480 &afw_s_description, &description->internal, xctx);
1483 afw_value_contextual_resolve_value_source(&value_source,
1486 &afw_s_value, &value_source, xctx);
1499 value, x->
argv[5], x->
p, xctx);
1588 &qualifier->internal,
1589 (forTesting && forTesting->internal),
1643 (forTesting && forTesting->internal),
1716 error_in_compile_expect,
1717 error_in_evaluate_expect,
1718 error_in_compile_source,
1719 error_in_evaluate_source
1727 test_script = testScriptObject->internal;
1729 &afw_s_tests, xctx);
1731 test_script, &afw_s_sourceType, xctx);
1732 if (!default_source_type) {
1733 default_source_type = &afw_s_script;
1735 for (iterator = NULL;;) {
1742 &afw_s_sourceType, xctx);
1744 source_type = default_source_type;
1749 &afw_s_expect, xctx);
1755 test, &afw_s_expectUTF8OctetLengthInTestScript, &found, xctx);
1760 test, &afw_s_expectUTF8OctetOffsetInTestScript, &found, xctx);
1766 &afw_s_source, xctx);
1771 &afw_s_sourceLocation, xctx);
1772 if (!sourceLocation) {
1773 sourceLocation = &afw_s_test_script;
1776 test, &afw_s_sourceUTF8OctetOffsetInTestScript, &found, xctx);
1781 test, &afw_s_sourceUTF8OctetLengthInTestScript, &found, xctx);
1788 &afw_s_skip, &found, xctx))
1793 if (info->compile_type == afw_compile_type_error) {
1800 error_in = error_in_other;
1802 expected_value = NULL;
1805 error_in = error_in_compile_expect;
1810 expectUTF8OctetOffsetInTestScript, xctx);
1812 expectUTF8OctetLengthInTestScript, xctx);
1814 argv[0] = (
const afw_value_t *)info->compile_function;
1817 compiled_value = afw_value_call_built_in_function(
1818 contextual, info->compile_function, 1, argv, x->
p, xctx);
1819 error_in = error_in_evaluate_expect;
1824 error_in = error_in_compile_source;
1829 sourceUTF8OctetOffsetInTestScript, xctx);
1831 sourceUTF8OctetLengthInTestScript, xctx);
1833 argv[0] = (
const afw_value_t *)info->compile_function;
1836 compiled_value = afw_value_call_built_in_function(
1837 contextual, info->compile_function, 1, argv, x->
p, xctx);
1838 error_in = error_in_evaluate_source;
1841 error_in = error_in_other;
1844 evaluated_value, xctx);
1864 expected_error =
false;
1866 if (expect->len == afw_s_error.len) {
1867 expected_error =
true;
1870 expect_message.s = expect->s + afw_s_error.len + 1;
1871 expect_message.len = expect->len - afw_s_error.len - 1;
1874 expect_message.len) == 0)
1876 expected_error =
true;
1890 case error_in_compile_expect:
1891 errorReason = &afw_s_a_compile_expect_error;
1894 case error_in_evaluate_expect:
1895 errorReason = &afw_s_a_evaluate_expect_error;
1898 case error_in_compile_source:
1899 errorReason = &afw_s_a_compile_source_error;
1902 case error_in_evaluate_source:
1903 errorReason = &afw_s_a_evaluate_source_error;
1907 errorReason = &afw_s_a_other_error;
1911 &afw_s_errorReason, errorReason, xctx);
AFW_DEFINE(const afw_object_t *)
Adaptive Framework Core Internal.
#define afw_value_is_boolean(A_VALUE)
Macro to determine if value is evaluated boolean.
#define afw_object_old_get_property_as_boolean(object, property_name, found, xctx)
Get property function for data type boolean value.
#define afw_object_old_get_property_as_integer(object, property_name, found, xctx)
Get property function for data type integer value.
#define afw_value_is_integer(A_VALUE)
Macro to determine if value is evaluated integer.
#define afw_object_old_get_property_as_list(object, property_name, xctx)
Get property function for data type list value.
afw_object_set_property_as_object(const afw_object_t *object, const afw_utf8_t *property_name, const afw_object_t *internal, afw_xctx_t *xctx)
Set property function for data type object values.
afw_value_create_object(const afw_object_t *internal, const afw_pool_t *p, afw_xctx_t *xctx)
Create function for unmanaged data type object value.
afw_value_as_object(const afw_value_t *value, afw_xctx_t *xctx)
Typesafe cast of data type object.
afw_value_create_string(const afw_utf8_t *internal, const afw_pool_t *p, afw_xctx_t *xctx)
Create function for unmanaged data type string value.
#define afw_object_old_get_property_as_string(object, property_name, xctx)
Get property function for data type string value.
#define afw_value_is_string(A_VALUE)
Macro to determine if value is evaluated string.
afw_object_set_property_as_string(const afw_object_t *object, const afw_utf8_t *property_name, const afw_utf8_t *internal, afw_xctx_t *xctx)
Set property function for data type string values.
#define AFW_UTF8_FMT_ARG(A_STRING)
Convenience Macro for use with AFW_UTF8_FMT to specify arg.
struct afw_iterator_s afw_iterator_t
#define AFW_UTF8_FMT
Format string specifier used for afw_utf8_t.
apr_size_t afw_size_t
size_t.
#define AFW_SIZE_T_FMT
Format string specifier used for afw_size_t.
apr_int64_t afw_integer_t
typedef for big signed int.
#define afw_compile_to_value(string, source_location, compile_type, parent, shared, p, xctx)
Compile string to adaptive value.
afw_compile_type_get_info_by_pneumonic(const afw_utf8_t *pneumonic, const afw_xctx_t *xctx)
Return compile type info for a pneumonic.
#define AFW_CATCH_UNHANDLED
Catch an unhandled error that occurs in a AFW_TRY block.
#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_MARK_UNHANDLED
Use in an AFW_CATCH or AFW_CATCH_UNHANDLED block to mark error as unhandled and break.
const afw_object_t * afw_error_to_object(const afw_error_t *error, const afw_pool_t *p, afw_xctx_t *xctx)
Create an object with error info in specified pool.
#define AFW_ERROR_THROWN
Access the thrown error. See AFW_TRY.
#define AFW_THROW_ERROR_Z(code, message_z, xctx)
Macro used to set error and 0 rv in xctx and throw it.
#define AFW_FUNCTION_EVALUATE_DATA_TYPE_PARAMETER(A_RESULT, A_N, A_TYPE)
Evaluate an arg for a particular data type.
#define AFW_FUNCTION_SOURCE_LOCATION
Source location of a value.
#define AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(A_RESULT, A_N, A_TYPE)
Evaluate an arg for a particular data type.
#define AFW_FUNCTION_ARGV(A_N)
Get the unevaluated argv value or NULL.
#define AFW_FUNCTION_PARAMETER_IS_PRESENT(A_N)
Determine if a specific parameter value is present.
#define AFW_FUNCTION_EVALUATE_PARAMETER(A_RESULT, A_N)
Evaluate a parameter.
#define AFW_FUNCTION_EVALUATE_REQUIRED_PARAMETER(A_RESULT, A_N)
Evaluate an required parameter.
const afw_value_t * afw_function_execute_compile_relaxed_json(afw_function_execute_t *x)
Adaptive Function compile_relaxed_json
const afw_value_t * afw_function_execute_assert(afw_function_execute_t *x)
Adaptive Function assert
const afw_value_t * afw_function_execute_stringify(afw_function_execute_t *x)
Adaptive Function stringify
const afw_value_t * afw_function_execute_evaluate_with_retry(afw_function_execute_t *x)
Adaptive Function evaluate_with_retry
const afw_value_t * afw_function_execute_test_expression(afw_function_execute_t *x)
Adaptive Function test_expression
const afw_value_t * afw_function_execute_compile_expression_tuple(afw_function_execute_t *x)
Adaptive Function compile_expression_tuple
const afw_value_t * afw_function_execute_test_hybrid(afw_function_execute_t *x)
Adaptive Function test_hybrid
const afw_value_t * afw_function_execute_decompile(afw_function_execute_t *x)
Adaptive Function decompile
const afw_value_t * afw_function_execute_test_template(afw_function_execute_t *x)
Adaptive Function test_template
const afw_value_t * afw_function_execute_evaluate_expression_tuple(afw_function_execute_t *x)
Adaptive Function evaluate_expression_tuple
const afw_value_t * afw_function_execute_convert_syntax_hybrid_to_expression(afw_function_execute_t *x)
Adaptive Function convert_syntax_hybrid_to_expression
const afw_value_t * afw_function_execute_compile_json(afw_function_execute_t *x)
Adaptive Function compile_json
const afw_value_t * afw_function_execute_safe_evaluate(afw_function_execute_t *x)
Adaptive Function safe_evaluate
const afw_value_t * afw_function_execute_test_script(afw_function_execute_t *x)
Adaptive Function test_script
const afw_value_t * afw_function_execute_evaluate_value(afw_function_execute_t *x)
Adaptive Function evaluate_value
const afw_value_t * afw_function_execute_qualifiers(afw_function_execute_t *x)
Adaptive Function qualifiers
const afw_value_t * afw_function_execute_test_expression_tuple(afw_function_execute_t *x)
Adaptive Function test_expression_tuple
const afw_value_t * afw_function_execute_qualifier(afw_function_execute_t *x)
Adaptive Function qualifier
const afw_value_t * afw_function_execute_test_value(afw_function_execute_t *x)
Adaptive Function test_value
const afw_value_t * afw_function_execute_test_script_runtime_support(afw_function_execute_t *x)
Adaptive Function test_script_runtime_support
const afw_utf8_t * afw_json_from_value(const afw_value_t *value, const afw_object_options_t *options, const afw_pool_t *p, afw_xctx_t *xctx)
Convert an adaptive value to JSON.
#define afw_list_get_next_value(instance, iterator, p, xctx)
Call method get_next_value of interface afw_list.
#define afw_memory_copy(to, from)
Copy to preallocated memory of same type.
#define afw_object_create_managed(p, xctx)
Create an empty entity object in its own pool.
afw_object_set_property(const afw_object_t *instance, const afw_utf8_t *property_name, const afw_value_t *value, afw_xctx_t *xctx)
Set the value of an object's property.
#define afw_pool_calloc_type(instance, type, xctx)
Macro to allocate cleared memory to hold type in pool.
afw_size_t afw_safe_cast_integer_to_size(afw_integer_t integer, afw_xctx_t *xctx)
Safely cast afw_integer_t to afw_size_t.
afw_boolean_t afw_utf8_equal(const afw_utf8_t *s1, const afw_utf8_t *s2)
Check to see if a string equals another string.
afw_boolean_t afw_utf8_starts_with(const afw_utf8_t *string, const afw_utf8_t *starts_with)
Check to see if a string starts with another string.
#define afw_utf8_create(s, len, p, xctx)
Create utf-8 string without copy unless necessary in pool specified.
afw_value_compiler_listing_to_string(const afw_value_t *value, const afw_utf8_t *tab, const afw_pool_t *p, afw_xctx_t *xctx)
Decompile a value to a compiler listing string.
#define afw_value_evaluate(value, p, xctx)
Evaluate value if needed using specific pool.
afw_value_equal(const afw_value_t *value1, const afw_value_t *value2, afw_xctx_t *xctx)
Test whether two values are equal.
const afw_utf8_t * afw_value_decompile_to_string(const afw_value_t *value, const afw_utf8_t *tab, const afw_pool_t *p, afw_xctx_t *xctx)
Decompile a value to a string.
afw_value_false
Adaptive value false.
#define afw_value_is_nullish(A_VALUE)
Determine if value is undefined or null.
afw_value_empty_string
Adaptive value empty string.
afw_value_convert(const afw_value_t *value, const afw_data_type_t *to_data_type, afw_boolean_t required, const afw_pool_t *p, afw_xctx_t *xctx)
Convert a value to a value/data type.
afw_value_as_casted_utf8(const afw_value_t *value, const afw_pool_t *p, afw_xctx_t *xctx)
Convert value to casted utf8 in specified pool.
afw_value_evaluate_with_additional_untrusted_qualified_variables(const afw_value_t *value, const afw_value_t *untrusted_qualified_variables, const afw_pool_t *p, afw_xctx_t *xctx)
Evaluate a value with additional insecure context.
afw_value_null
Adaptive value null.
#define afw_value_is_any_call(A_VALUE)
Macro to determine if value is a call.
afw_value_true
Adaptive value true.
afw_xctx_qualifiers_object_create(afw_boolean_t for_testing, const afw_pool_t *p, afw_xctx_t *xctx)
Create object to access active qualified variables.
afw_xctx_qualifier_object_create(const afw_utf8_t *qualifier, afw_boolean_t for_testing, const afw_pool_t *p, afw_xctx_t *xctx)
Create object to access active variables for a qualifier.
Contextual information provided in some values.
afw_size_t value_size
Size in full_source of value source.
afw_size_t value_offset
Offset in full source of compiled value to this value.
Struc for afw_compile_type_info_t.
Function execute parameter.
const afw_value_t *const * argv
This is the function parameters.
afw_xctx_t * xctx
The execution context (xctx) of caller.
const afw_pool_t * p
Pool for result.
const afw_value_call_built_in_function_t * self
self of call_built_in_function.
Interface afw_list public struct.
Interface afw_object public struct.
NFC normalized UTF-8 string.
struct for data type boolean values.
const afw_compile_value_contextual_t * contextual
struct for data type integer values.
struct for data type list values.
struct for data type object values.
Interface afw_value public struct.
struct for data type string values.
Interface afw_xctx public struct.