aboutsummaryrefslogtreecommitdiffstats
path: root/src/read_ntriples.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/read_ntriples.c')
-rw-r--r--src/read_ntriples.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/read_ntriples.c b/src/read_ntriples.c
index e5101522..c431574a 100644
--- a/src/read_ntriples.c
+++ b/src/read_ntriples.c
@@ -178,7 +178,7 @@ read_pct_encoded(SerdReader* const reader, SerdNode* const node)
return st;
}
-SerdStatus
+static SerdStatus
read_IRIREF_suffix(SerdReader* const reader, SerdNode* const node)
{
SerdStatus st = SERD_SUCCESS;
@@ -239,6 +239,25 @@ read_IRIREF_suffix(SerdReader* const reader, SerdNode* const node)
return st;
}
+// Note that read_IRI is used instead for NTriples, but this is used by Turtle
+SerdStatus
+read_IRIREF(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;
+ }
+
+ st = read_IRIREF_suffix(reader, *dest);
+ if (!tolerate_status(reader, st)) {
+ return st;
+ }
+
+ return push_node_tail(reader);
+}
+
/**
Read an absolute IRI.