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.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/read_ntriples.c b/src/read_ntriples.c
index a0982cfa..78e46634 100644
--- a/src/read_ntriples.c
+++ b/src/read_ntriples.c
@@ -178,18 +178,24 @@ read_IRIREF_suffix(SerdReader* const reader, SerdNode* const node)
return tolerate_status(reader, st) ? SERD_SUCCESS : st;
}
-SerdStatus
+/**
+ Read an absolute IRI.
+
+ This is a stricter subset of [8] IRIREF in the NTriples grammar, since a
+ scheme is required. Handling this in the parser results in better error
+ messages.
+*/
+static SerdStatus
read_IRI(SerdReader* const reader, SerdNode** const dest)
{
- SerdStatus st = SERD_SUCCESS;
- if ((st = eat_byte_check(reader, '<'))) {
- return st;
- }
+ assert(peek_byte(reader) == '<');
+ eat_byte(reader);
if (!(*dest = push_node(reader, SERD_URI, "", 0))) {
return SERD_ERR_OVERFLOW;
}
+ SerdStatus st = SERD_SUCCESS;
if ((st = read_IRI_scheme(reader, *dest))) {
return r_err(reader, st, "expected IRI scheme");
}