aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--serd/serd.h5
-rw-r--r--src/writer.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/serd/serd.h b/serd/serd.h
index de2be28d..91dd7076 100644
--- a/serd/serd.h
+++ b/serd/serd.h
@@ -74,6 +74,9 @@ typedef enum {
* @ref SERD_ANON equivalent to SERD_BLANK_ID.
*/
typedef enum {
+ /** The type of a NULL node. */
+ SERD_NOTHING = 0,
+
/** Literal value. A literal optionally has either an associated language,
* or an associated datatype (not both).
*/
@@ -171,7 +174,7 @@ typedef struct {
const uint8_t* buf; ///< Buffer
} SerdNode;
-static const SerdNode SERD_NODE_NULL = { 0, 0, 0, 0 };
+static const SerdNode SERD_NODE_NULL = { SERD_NOTHING, 0, 0, 0 };
/** Make a deep copy of @a node.
* @return a node that the caller must free with @ref serd_node_free.
diff --git a/src/writer.c b/src/writer.c
index 5f08df62..8010dba3 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -166,6 +166,8 @@ write_node(SerdWriter writer,
SerdChunk uri_prefix;
SerdChunk uri_suffix;
switch (node->type) {
+ case SERD_NOTHING:
+ return false;
case SERD_ANON_BEGIN:
if (writer->syntax != SERD_NTRIPLES) {
++writer->indent;