4
4
* @author Michal Vasko <[email protected] >
5
5
* @brief YIN parser.
6
6
*
7
- * Copyright (c) 2015 - 2022 CESNET, z.s.p.o.
7
+ * Copyright (c) 2015 - 2024 CESNET, z.s.p.o.
8
8
*
9
9
* This source code is licensed under BSD 3-Clause License (the "License").
10
10
* You may not use this file except in compliance with the License.
@@ -3409,6 +3409,14 @@ yin_parse_extension_instance(struct lysp_yin_ctx *ctx, const void *parent, enum
3409
3409
if (ctx -> xmlctx -> ws_only ) {
3410
3410
LY_CHECK_RET (lyxml_ctx_next (ctx -> xmlctx ));
3411
3411
while (ctx -> xmlctx -> status == LYXML_ELEMENT ) {
3412
+ /* BUG nested extensions will not be parsed because we are not able to dinsguish between them
3413
+ * and the argument of this extension, in case there is one and its 'yin-element' is 'true'
3414
+ stmt = yin_match_keyword(ctx, ctx->xmlctx->name, ctx->xmlctx->name_len, ctx->xmlctx->prefix,
3415
+ ctx->xmlctx->prefix_len, LY_STMT_EXTENSION_INSTANCE);
3416
+ if (stmt == LY_STMT_EXTENSION_INSTANCE) {
3417
+ LY_CHECK_RET(yin_parse_extension_instance(ctx, e, LY_STMT_EXTENSION_INSTANCE, 0, &e->exts));
3418
+ } else { */
3419
+
3412
3420
LY_CHECK_RET (yin_parse_element_generic (ctx , LY_STMT_EXTENSION_INSTANCE , & new_subelem ));
3413
3421
if (!e -> child ) {
3414
3422
e -> child = new_subelem ;
@@ -3420,6 +3428,9 @@ yin_parse_extension_instance(struct lysp_yin_ctx *ctx, const void *parent, enum
3420
3428
assert (ctx -> xmlctx -> status == LYXML_ELEM_CLOSE );
3421
3429
LY_CHECK_RET (lyxml_ctx_next (ctx -> xmlctx ));
3422
3430
}
3431
+
3432
+ /* store extension instance array (no realloc anymore) to find the plugin records and finish parsing */
3433
+ LY_CHECK_RET (yin_unres_exts_add (ctx , e -> exts ));
3423
3434
} else if (ctx -> xmlctx -> value_len ) {
3424
3435
/* invalid text content */
3425
3436
LOGVAL_PARSER (ctx , LYVE_SYNTAX , "Extension instance \"%s\" with unexpected text content \"%.*s\"." , ext_name ,
0 commit comments