28 afw_compile_get_token();
30 if (afw_compile_token_is(substitute_start)) {
31 result = afw_compile_parse_list_of_statements(parser,
57 apr_array_header_t *values;
66 values = apr_array_make(parser->apr_p, 5,
sizeof(
afw_value_t *));
69 afw_compile_save_cursor(start_offset);
70 afw_compile_save_cursor(string_cursor);
71 for (substitution =
false;;) {
74 afw_compile_save_cursor(previous_cursor);
75 cp = afw_compile_get_code_point();
79 cp = afw_compile_get_code_point();
81 len = afw_compile_source_buffer_length_from(string_cursor) - 1;
86 afw_compile_source_buffer_at(string_cursor),
92 afw_compile_save_cursor(string_cursor);
95 afw_compile_restore_cursor(previous_cursor);
96 cp = afw_compile_get_code_point();
101 cp = afw_compile_get_code_point();
103 afw_compile_restore_cursor(previous_cursor);
109 if ((substitution || cp < 0) &&
110 !afw_compile_cursor_equal(string_cursor))
113 afw_compile_source_buffer_at(string_cursor),
114 afw_compile_source_buffer_length_from(string_cursor),
115 parser->p, parser->xctx);
126 afw_compile_parse_Substitution(parser);
127 substitution =
false;
128 afw_compile_save_cursor(string_cursor);
133 if (values->nelts == 0) {
138 if (values->nelts == 1 &&
146 afw_compile_create_contextual_to_cursor(start_offset),
149 parser->p, parser->xctx);
163 apr_array_header_t *values;
170 afw_compile_get_token_and_save_offset(start_offset);
172 if (!afw_compile_token_is(grave)) {
176 values = apr_array_make(parser->apr_p, 5,
sizeof(
afw_value_t *));
179 apr_array_clear(parser->s);
182 afw_compile_save_cursor(start_offset);
183 for (substitution =
false;;) {
186 afw_compile_save_cursor(previous_cursor);
187 cp = afw_compile_get_unescaped_code_point();
191 afw_compile_save_cursor(previous_cursor2);
192 cp2 = afw_compile_get_code_point();
194 afw_compile_restore_cursor(previous_cursor);
198 afw_compile_restore_cursor(previous_cursor2);
199 afw_compile_internal_s_push_code_point(parser, cp);
205 else if (cp !=
'`') {
206 afw_compile_internal_s_push_code_point(parser, cp);
210 if ((substitution || cp ==
'`') && parser->s->nelts > 0)
214 parser->p, parser->xctx);
217 apr_array_clear(parser->s);
228 afw_compile_parse_Substitution(parser);
229 substitution =
false;
230 apr_array_clear(parser->s);
235 if (values->nelts == 0) {
240 if (values->nelts == 1 &&
248 afw_compile_create_contextual_to_cursor(start_offset),
251 parser->p, parser->xctx);
#define AFW_DEFINE_INTERNAL(type)
Define an internal function for /src/afw/ source*.c files.
Adaptive Framework Core Internal.
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_value_is_string(A_VALUE)
Macro to determine if value is evaluated string.
afw_int32_t afw_code_point_t
Unicode code point.
char afw_utf8_octet_t
8 bits of utf-8 codepoint.
apr_size_t afw_size_t
size_t.
#define AFW_COMPILE_THROW_ERROR_Z(message_z)
#define afw_pool_malloc(instance, size, xctx)
Call method malloc of interface afw_pool.
#define afw_utf8_create_copy(s, len, p, xctx)
Make a utf-8 sting from chars in pool specified.
#define afw_utf8_create(s, len, p, xctx)
Create utf-8 string without copy unless necessary in pool specified.
const afw_value_t * afw_value_template_definition_create(const afw_compile_value_contextual_t *contextual, afw_size_t count, const afw_value_t *const *values, const afw_pool_t *p, afw_xctx_t *xctx)
Create function for template definition value.
afw_value_empty_string
Adaptive value empty string.
NFC normalized UTF-8 string.
Interface afw_value public struct.