aboutsummaryrefslogtreecommitdiffstats
path: root/src/read_turtle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/read_turtle.c')
-rw-r--r--src/read_turtle.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/src/read_turtle.c b/src/read_turtle.c
index a041e873..e8e57dfc 100644
--- a/src/read_turtle.c
+++ b/src/read_turtle.c
@@ -360,23 +360,15 @@ resolve_IRIREF(SerdReader* const reader,
}
static SerdStatus
-read_IRIREF(SerdReader* const reader, SerdNode** const dest)
+read_IRI(SerdReader* const reader, SerdNode** const dest)
{
SerdStatus st = SERD_SUCCESS;
- TRY(st, eat_byte_check(reader, '<'));
- if (!(*dest = push_node_head(reader, SERD_URI))) {
- return SERD_BAD_STACK;
- }
-
- const size_t string_start_offset = reader->stack.size;
+ const size_t node_start_offset = reader->stack.size;
- st = read_IRIREF_suffix(reader, *dest);
- if (!tolerate_status(reader, st)) {
- return st;
- }
+ TRY(st, read_IRIREF(reader, dest));
- TRY(st, push_node_tail(reader));
+ const size_t string_start_offset = node_start_offset + sizeof(SerdNode);
return (reader->flags & SERD_READ_RELATIVE)
? st
@@ -516,7 +508,7 @@ read_turtle_iri(SerdReader* const reader,
bool* const ate_dot)
{
if (peek_byte(reader) == '<') {
- return read_IRIREF(reader, dest);
+ return read_IRI(reader, dest);
}
if (!(*dest = push_node_head(reader, SERD_LITERAL))) {
@@ -572,7 +564,7 @@ read_verb(SerdReader* reader, SerdNode** const dest)
case '?':
return read_Var(reader, dest);
case '<':
- return read_IRIREF(reader, dest);
+ return read_IRI(reader, dest);
}
/* Either a qname, or "a". Read the prefix first, and if it is in fact
@@ -747,7 +739,7 @@ read_object(SerdReader* const reader,
st = read_BLANK_NODE_LABEL(reader, &o, ate_dot);
break;
case '<':
- st = read_IRIREF(reader, &o);
+ st = read_IRI(reader, &o);
break;
case ':':
st = read_turtle_iri(reader, &o, ate_dot);
@@ -989,7 +981,7 @@ read_turtle_base(SerdReader* const reader, const bool sparql, const bool token)
read_turtle_ws_star(reader);
SerdNode* uri = NULL;
- TRY(st, read_IRIREF(reader, &uri));
+ TRY(st, read_IRI(reader, &uri));
if (reader->stack.size + sizeof(SerdNode) > reader->stack.buf_size) {
return SERD_BAD_STACK;
@@ -1035,7 +1027,7 @@ read_turtle_prefixID(SerdReader* const reader,
// Read URI node
SerdNode* uri = NULL;
- TRY(st, read_IRIREF(reader, &uri));
+ TRY(st, read_IRI(reader, &uri));
TRY(st,
serd_env_set_prefix(