aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-12-19 10:21:30 -0500
committerDavid Robillard <d@drobilla.net>2021-03-07 15:32:24 -0500
commit194d6f42583745c3fde6387b14abab2311b4f0b7 (patch)
tree987213e9427abb56b938c1cd98cc336a09f4c2b9
parentb2b4fa05b73c6eee51ee9db59726fc404198111a (diff)
downloadserd-194d6f42583745c3fde6387b14abab2311b4f0b7.tar.gz
serd-194d6f42583745c3fde6387b14abab2311b4f0b7.tar.bz2
serd-194d6f42583745c3fde6387b14abab2311b4f0b7.zip
Remove SERD_NOTHING node type
-rw-r--r--include/serd/serd.h7
-rw-r--r--src/env.c1
-rw-r--r--src/writer.c3
-rw-r--r--test/test_reader_writer.c16
4 files changed, 1 insertions, 26 deletions
diff --git a/include/serd/serd.h b/include/serd/serd.h
index 7a690b5b..2ccedcba 100644
--- a/include/serd/serd.h
+++ b/include/serd/serd.h
@@ -133,13 +133,6 @@ typedef uint32_t SerdStatementFlags;
*/
typedef enum {
/**
- The type of a nonexistent node.
-
- This type is useful as a sentinel, but is never emitted by the reader.
- */
- SERD_NOTHING = 0,
-
- /**
Literal value.
A literal optionally has either a language, or a datatype (not both).
diff --git a/src/env.c b/src/env.c
index c4744885..f88b8ab1 100644
--- a/src/env.c
+++ b/src/env.c
@@ -222,7 +222,6 @@ SerdNode*
serd_env_expand_node(const SerdEnv* env, const SerdNode* node)
{
switch (node->type) {
- case SERD_NOTHING:
case SERD_LITERAL:
break;
case SERD_URI: {
diff --git a/src/writer.c b/src/writer.c
index dd16e732..6df55ada 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -737,8 +737,6 @@ write_node(SerdWriter* writer,
{
bool ret = false;
switch (node->type) {
- case SERD_NOTHING:
- break;
case SERD_LITERAL:
ret = write_literal(writer, node, datatype, lang, flags);
break;
@@ -752,7 +750,6 @@ write_node(SerdWriter* writer,
ret = write_blank(writer, node, field, flags);
break;
}
-
writer->last_sep = SEP_NONE;
return ret;
}
diff --git a/test/test_reader_writer.c b/test/test_reader_writer.c
index 5d8efbe3..a97a44c0 100644
--- a/test/test_reader_writer.c
+++ b/test/test_reader_writer.c
@@ -260,22 +260,8 @@ test_writer(const char* const path)
assert(!strcmp(out, "@base <http://example.org/base> .\n"));
serd_free(out);
- // Test writing empty node
- SerdNode* nothing = serd_new_string(SERD_NOTHING, "");
- FILE* const empty = tmpfile();
-
- writer = serd_writer_new(SERD_TURTLE, 0, env, NULL, serd_file_sink, empty);
-
- // FIXME: error handling
- serd_writer_write_statement(writer, 0, NULL, s, p, nothing, NULL, NULL);
-
- assert((size_t)ftell(empty) == strlen("<>\n\t<http://example.org/pred> "));
-
- serd_writer_free(writer);
- fclose(empty);
- serd_node_free(nothing);
- serd_node_free(s);
serd_node_free(p);
+ serd_node_free(s);
serd_env_free(env);
fclose(fd);