aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-06-03 12:49:44 +0200
committerDavid Robillard <d@drobilla.net>2018-11-25 22:12:47 +0100
commit45a2fee262b684f8e218067bd1a7ed978b83fab7 (patch)
tree5095864bb52d6ec8995c7baf658d7702d33101d7
parentd6f1e256ad3fc59160f5cf60820572cc8b83ec7c (diff)
downloadserd-45a2fee262b684f8e218067bd1a7ed978b83fab7.tar.gz
serd-45a2fee262b684f8e218067bd1a7ed978b83fab7.tar.bz2
serd-45a2fee262b684f8e218067bd1a7ed978b83fab7.zip
Expand datatype of literal nodes in serd_env_expand_node
-rw-r--r--src/env.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/env.c b/src/env.c
index c9982c22..fe122c0a 100644
--- a/src/env.c
+++ b/src/env.c
@@ -235,6 +235,18 @@ serd_env_expand_node(const SerdEnv* env,
ret->n_bytes = len;
return ret;
}
+ case SERD_LITERAL:
+ if (serd_node_get_datatype(node)) {
+ SerdNode* datatype = serd_env_expand_node(
+ env, serd_node_get_datatype(node));
+ if (datatype) {
+ SerdNode* ret = serd_node_new_literal(
+ serd_node_get_string(node), datatype, NULL);
+ serd_node_free(datatype);
+ return ret;
+ }
+ }
+ return NULL;
case SERD_URI:
return serd_node_new_resolved_uri_i(
serd_node_get_string(node), &env->base_uri);