diff options
author | David Robillard <d@drobilla.net> | 2022-12-09 17:31:46 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 18:49:07 -0500 |
commit | 0611f1446c37915708ce0ea337c9e84d4cbc3be4 (patch) | |
tree | dcf34d085f8cdbe41ac1f18848619caa9c4d8059 /src/read_ntriples.c | |
parent | d22653dfe356e3da1354cdb0f7915e29c4a33e3b (diff) | |
download | serd-0611f1446c37915708ce0ea337c9e84d4cbc3be4.tar.gz serd-0611f1446c37915708ce0ea337c9e84d4cbc3be4.tar.bz2 serd-0611f1446c37915708ce0ea337c9e84d4cbc3be4.zip |
Factor out NQuads reader
Diffstat (limited to 'src/read_ntriples.c')
-rw-r--r-- | src/read_ntriples.c | 13 |
1 files changed, 9 insertions, 4 deletions
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; |