yin parser: identities support
diff --git a/src/print.c b/src/print.c
index f57a673..2f7819e 100644
--- a/src/print.c
+++ b/src/print.c
@@ -135,6 +135,25 @@
 	fprintf(f, "%*s}\n", LEVEL, INDENT);
 }
 
+static void yang_print_identity(FILE *f, int level, struct ly_ident *ident)
+{
+	fprintf(f, "%*sidentity %s {\n", LEVEL, INDENT, ident->name);
+	level++;
+
+	yang_print_mnode_common(f, level, (struct ly_mnode *)ident);
+	if (ident->base) {
+		if (ident->base->module == ident->module) {
+			fprintf(f, "%*sbase %s;\n", LEVEL, INDENT, ident->base->name);
+		} else {
+			fprintf(f, "%*sbase %s:%s;\n", LEVEL, INDENT, ident->base->module->prefix, ident->base->name);
+		}
+	}
+
+	level--;
+	fprintf(f, "%*s}\n", LEVEL, INDENT);
+
+}
+
 static void yang_print_container(FILE *f, int level, struct ly_mnode *mnode)
 {
 	int i;
@@ -339,6 +358,10 @@
 		}
 	}
 
+	for (i = 0; i < module->ident_size; i++) {
+		yang_print_identity(f, level, &module->ident[i]);
+	}
+
 	for (i = 0; i < module->tpdf_size; i++) {
 		yang_print_typedef(f, level, &module->tpdf[i]);
 	}