aboutsummaryrefslogtreecommitdiffstats
path: root/src/writer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/writer.c')
-rw-r--r--src/writer.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/writer.c b/src/writer.c
index b1404a91..fbc9dd5d 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -881,6 +881,18 @@ write_blank(SerdWriter* const writer,
}
SERD_WARN_UNUSED_RESULT static SerdStatus
+write_variable(SerdWriter* const writer, const SerdNode* node)
+{
+ SerdStatus st = SERD_SUCCESS;
+
+ TRY(st, esink("?", 1, writer));
+ TRY(st, esink(serd_node_string(node), node->n_bytes, writer));
+
+ writer->last_sep = SEP_NONE;
+ return st;
+}
+
+SERD_WARN_UNUSED_RESULT static SerdStatus
write_node(SerdWriter* writer,
const SerdNode* node,
const SerdField field,
@@ -895,6 +907,8 @@ write_node(SerdWriter* writer,
return write_curie(writer, node, field, flags);
case SERD_BLANK:
return write_blank(writer, node, field, flags);
+ case SERD_VARIABLE:
+ return write_variable(writer, node);
}
return SERD_ERR_INTERNAL;