diff options
author | David Robillard <d@drobilla.net> | 2018-06-03 12:49:44 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-03-08 23:23:05 -0500 |
commit | 8f84a055c88c2c271abe9cf86e998a3e5d0a4ced (patch) | |
tree | c7662939be38c7ad93f0e336d080251dedeac166 /src | |
parent | ef758859f54c37e90deb419fa4e58a9609ea1999 (diff) | |
download | serd-8f84a055c88c2c271abe9cf86e998a3e5d0a4ced.tar.gz serd-8f84a055c88c2c271abe9cf86e998a3e5d0a4ced.tar.bz2 serd-8f84a055c88c2c271abe9cf86e998a3e5d0a4ced.zip |
Expand datatype of literal nodes in serd_env_expand_node
Diffstat (limited to 'src')
-rw-r--r-- | src/env.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -205,8 +205,20 @@ SerdNode* serd_env_expand_node(const SerdEnv* env, const SerdNode* node) { switch (node->type) { - case SERD_LITERAL: - break; + case SERD_LITERAL: { + const SerdNode* const short_datatype = serd_node_datatype(node); + if (short_datatype) { + SerdNode* const datatype = serd_env_expand_node(env, short_datatype); + if (datatype) { + SerdNode* ret = serd_new_literal(serd_node_string_view(node), + serd_node_string_view(datatype), + SERD_EMPTY_STRING()); + serd_node_free(datatype); + return ret; + } + } + return NULL; + } case SERD_URI: return serd_new_resolved_uri(serd_node_string_view(node), env->base_uri); case SERD_CURIE: { |