From 0611f1446c37915708ce0ea337c9e84d4cbc3be4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 9 Dec 2022 17:31:46 -0500 Subject: Factor out NQuads reader --- src/read_ntriples.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/read_ntriples.c') diff --git a/src/read_ntriples.c b/src/read_ntriples.c index 3063a667..3d3af2ce 100644 --- a/src/read_ntriples.c +++ b/src/read_ntriples.c @@ -191,13 +191,18 @@ 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; - } + TRY(st, eat_byte_check(reader, '<')); if (!(*dest = push_node(reader, SERD_URI, "", 0))) { return SERD_BAD_STACK; -- cgit v1.2.1