summaryrefslogtreecommitdiffstats
path: root/src/printer_yang.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 04:23:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 04:23:18 +0000
commitb90161ccd3b318f3314a23cb10c387651ad35831 (patch)
treea47dc087160299ce02d728cbf031d84af6281537 /src/printer_yang.c
parentAdding upstream version 2.1.30. (diff)
downloadlibyang2-upstream.tar.xz
libyang2-upstream.zip
Adding upstream version 2.1.148.upstream/2.1.148upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/printer_yang.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/printer_yang.c b/src/printer_yang.c
index ea643ac..8e0af18 100644
--- a/src/printer_yang.c
+++ b/src/printer_yang.c
@@ -628,9 +628,7 @@ yprc_must(struct lys_ypr_ctx *pctx, const struct lysc_must *must, ly_bool *flag)
ly_bool inner_flag = 0;
ypr_open(pctx->out, flag);
- ly_print_(pctx->out, "%*smust \"", INDENT);
- ypr_encode(pctx->out, must->cond->expr, -1);
- ly_print_(pctx->out, "\"");
+ ypr_text(pctx, "must", must->cond->expr, 1, 0);
LEVEL++;
yprc_extension_instances(pctx, LY_STMT_MUST, 0, must->exts, &inner_flag);
@@ -773,9 +771,7 @@ yprp_when(struct lys_ypr_ctx *pctx, const struct lysp_when *when, ly_bool *flag)
}
ypr_open(pctx->out, flag);
- ly_print_(pctx->out, "%*swhen \"", INDENT);
- ypr_encode(pctx->out, when->cond, -1);
- ly_print_(pctx->out, "\"");
+ ypr_text(pctx, "when", when->cond, 1, 0);
LEVEL++;
yprp_extension_instances(pctx, LY_STMT_WHEN, 0, when->exts, &inner_flag);
@@ -795,9 +791,7 @@ yprc_when(struct lys_ypr_ctx *pctx, const struct lysc_when *when, ly_bool *flag)
}
ypr_open(pctx->out, flag);
- ly_print_(pctx->out, "%*swhen \"", INDENT);
- ypr_encode(pctx->out, when->cond->expr, -1);
- ly_print_(pctx->out, "\"");
+ ypr_text(pctx, "when", when->cond->expr, 1, 0);
LEVEL++;
yprc_extension_instances(pctx, LY_STMT_WHEN, 0, when->exts, &inner_flag);