diff options
Diffstat (limited to 'src/writer.c')
-rw-r--r-- | src/writer.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/writer.c b/src/writer.c index 60a387c0..372e4279 100644 --- a/src/writer.c +++ b/src/writer.c @@ -943,6 +943,18 @@ write_blank(SerdWriter* const writer, } SERD_NODISCARD static SerdStatus +write_variable(SerdWriter* const writer, const SerdNode* const node) +{ + SerdStatus st = SERD_SUCCESS; + + TRY(st, esink("?", 1, writer)); + TRY(st, esink(serd_node_string(node), node->length, writer)); + + writer->last_sep = SEP_NONE; + return st; +} + +SERD_NODISCARD static SerdStatus write_node(SerdWriter* const writer, const SerdNode* const node, const SerdField field, @@ -963,6 +975,9 @@ write_node(SerdWriter* const writer, case SERD_BLANK: st = write_blank(writer, node, field, flags); break; + case SERD_VARIABLE: + st = write_variable(writer, node); + break; } if (node->type != SERD_BLANK) { |