parser CHANGE add flag for validation extension
diff --git a/src/resolve.c b/src/resolve.c
index 6a4c611..7f82540 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -4447,6 +4447,7 @@
(*ext)->insubstmt = info->substmt;
(*ext)->insubstmt_index = info->substmt_index;
(*ext)->ext_type = e->plugin ? e->plugin->type : LYEXT_FLAG;
+ (*ext)->flags |= e->plugin ? e->plugin->flags : 0;
if (e->argument) {
if (!(e->flags & LYS_YINELEM)) {
@@ -4468,6 +4469,11 @@
}
}
+ if ((*ext)->flags & LYEXT_OPT_VALID &&
+ (info->parent_type == LYEXT_PAR_NODE || info->parent_type == LYEXT_PAR_TPDF)) {
+ ((struct lys_node *)info->parent)->flags |= LYS_VALID_DATA;
+ }
+
(*ext)->nodetype = LYS_EXT;
(*ext)->module = info->mod;
@@ -4575,12 +4581,18 @@
(*ext)->def = e;
(*ext)->parent = info->parent;
(*ext)->ext_type = e->plugin ? e->plugin->type : LYEXT_FLAG;
+ (*ext)->flags |= e->plugin ? e->plugin->flags : 0;
if (e->argument && !(*ext)->arg_value) {
LOGVAL(LYE_MISSARG, LY_VLOG_NONE, NULL, e->argument, ext_name);
goto error;
}
+ if ((*ext)->flags & LYEXT_OPT_VALID &&
+ (info->parent_type == LYEXT_PAR_NODE || info->parent_type == LYEXT_PAR_TPDF)) {
+ ((struct lys_node *)info->parent)->flags |= LYS_VALID_DATA;
+ }
+
(*ext)->module = info->mod;
(*ext)->nodetype = LYS_EXT;