yin parser CHANGE add support for length element
diff --git a/src/parser_yin.c b/src/parser_yin.c
index 72636d5..9384bc2 100644
--- a/src/parser_yin.c
+++ b/src/parser_yin.c
@@ -894,6 +894,11 @@
case YANG_LEAF_LIST:
break;
case YANG_LENGTH:
+ type = (struct lysp_type *)subelem_info_rec->dest;
+ type->length = calloc(1, sizeof *type->length);
+ LY_CHECK_ERR_GOTO(!type->length, LOGMEM(ctx->xml_ctx.ctx); ret = LY_EMEM, cleanup);
+ ret = yin_parse_restriction(ctx, subelem_attrs, data, kw, type->length);
+ type->flags |= LYS_SET_LENGTH;
break;
case YANG_LIST:
break;
@@ -940,7 +945,7 @@
type->range = calloc(1, sizeof *type->range);
LY_CHECK_ERR_GOTO(!type->range, LOGMEM(ctx->xml_ctx.ctx); ret = LY_EMEM, cleanup);
ret = yin_parse_restriction(ctx, subelem_attrs, data, kw, type->range);
- type->flags |= LYS_SET_RANGE;
+ type->flags |= LYS_SET_RANGE;
break;
case YANG_REFINE:
break;