schema compile REFACTOR resolve unres at the end of module compilation
So that it can then be changed to resolve unres
at the end of all newly implemented modules compilation.
diff --git a/src/schema_compile.c b/src/schema_compile.c
index 6ac18af..da1eaa9 100644
--- a/src/schema_compile.c
+++ b/src/schema_compile.c
@@ -1648,13 +1648,10 @@
COMPILE_EXTS_GOTO(&ctx, submod->exts, mod_c->exts, mod_c, LYEXT_PAR_MODULE, ret, error);
}
-
- /* finish compilation for all unresolved items in the context */
- LY_CHECK_GOTO(ret = lys_compile_unres(&ctx), error);
+ ctx.pmod = sp;
/* validate non-instantiated groupings from the parsed schema,
* without it we would accept even the schemas with invalid grouping specification */
- ctx.pmod = sp;
ctx.options |= LYS_COMPILE_GROUPING;
LY_ARRAY_FOR(sp->groupings, u) {
if (!(sp->groupings[u].flags & LYS_USED_GRP)) {
@@ -1689,6 +1686,9 @@
}
ctx.pmod = sp;
+ /* finish compilation for all unresolved items in the context */
+ LY_CHECK_GOTO(ret = lys_compile_unres(&ctx), error);
+
/* there can be no leftover deviations or augments */
LY_CHECK_ERR_GOTO(ctx.augs.count, LOGINT(ctx.ctx); ret = LY_EINT, error);
LY_CHECK_ERR_GOTO(ctx.devs.count, LOGINT(ctx.ctx); ret = LY_EINT, error);