aboutsummaryrefslogtreecommitdiffstats
path: root/src/writer.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-14 17:32:01 +0200
committerDavid Robillard <d@drobilla.net>2021-03-08 23:23:05 -0500
commit0daee5d67f5924f260651556a46f0af354fca341 (patch)
tree2e000a4090e7d9ee2d57b1757e831942a70bc2c2 /src/writer.c
parent2ab2b5f2c7bd4d26aa99eee959f0e5192b3813dc (diff)
downloadserd-0daee5d67f5924f260651556a46f0af354fca341.tar.gz
serd-0daee5d67f5924f260651556a46f0af354fca341.tar.bz2
serd-0daee5d67f5924f260651556a46f0af354fca341.zip
Add empty syntax type for suppressing output
Diffstat (limited to 'src/writer.c')
-rw-r--r--src/writer.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/writer.c b/src/writer.c
index 71766d9d..afeee33d 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -843,6 +843,8 @@ write_curie(SerdWriter* const writer,
if (is_inline_start(writer, field, flags)) {
TRY(st, esink(" ;", 2, writer));
}
+ case SERD_SYNTAX_EMPTY:
+ break;
}
return st;
}
@@ -946,6 +948,10 @@ serd_writer_write_statement(SerdWriter* writer,
assert(!((flags & SERD_ANON_S) && (flags & SERD_LIST_S)));
assert(!((flags & SERD_ANON_O) && (flags & SERD_LIST_O)));
+ if (writer->syntax == SERD_SYNTAX_EMPTY) {
+ return SERD_SUCCESS;
+ }
+
SerdStatus st = SERD_SUCCESS;
const SerdNode* const subject = serd_statement_subject(statement);
const SerdNode* const predicate = serd_statement_predicate(statement);
@@ -1093,7 +1099,7 @@ serd_writer_write_statement(SerdWriter* writer,
SERD_WARN_UNUSED_RESULT static SerdStatus
serd_writer_end_anon(SerdWriter* writer, const SerdNode* node)
{
- if (writer->syntax == SERD_NTRIPLES || writer->syntax == SERD_NQUADS) {
+ if (writer->syntax != SERD_TURTLE && writer->syntax != SERD_TRIG) {
return SERD_SUCCESS;
}