yin parser BUGFIX import substatements
The "prefix" substatement is expected before the "revision-data".
diff --git a/src/parser_yin.c b/src/parser_yin.c
index 95608f6..c4238d2 100644
--- a/src/parser_yin.c
+++ b/src/parser_yin.c
@@ -2308,7 +2308,12 @@
imp->prefix = lydict_insert(module->ctx, value, strlen(value));
} else if (!strcmp(child->name, "revision-date")) {
if (imp->rev[0]) {
- LOGVAL(LYE_TOOMANY, LY_VLOG_NONE, NULL, "revision-date", yin->name);
+ LOGVAL(LYE_TOOMANY, LY_VLOG_NONE, NULL, child->name, yin->name);
+ goto error;
+ } else if (!imp->prefix) {
+ LOGVAL(LYE_INSTMT, LY_VLOG_NONE, NULL, child->name);
+ LOGVAL(LYE_SPEC, LY_VLOG_NONE, NULL,
+ "The \"prefix\" statement is expected before the \"revision-date\".");
goto error;
}
GETVAL(value, child, "date");