From 4196ab792e8f8957385fab68dd99c4cde19c870d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 3 May 2023 15:50:54 -0400 Subject: Make serd_reader_read_chunk() work with NQuads --- src/n3.c | 2 +- src/reader.c | 4 +++- src/reader.h | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/n3.c b/src/n3.c index c92059a5..d332504d 100644 --- a/src/n3.c +++ b/src/n3.c @@ -1723,7 +1723,7 @@ read_turtleTrigDoc(SerdReader* const reader) return SERD_SUCCESS; } -static SerdStatus +SerdStatus read_nquads_statement(SerdReader* const reader) { SerdStatus st = SERD_SUCCESS; diff --git a/src/reader.c b/src/reader.c index 32535ceb..5d87216d 100644 --- a/src/reader.c +++ b/src/reader.c @@ -357,7 +357,9 @@ serd_reader_read_chunk(SerdReader* const reader) st = skip_byte(reader, 0); } - return st ? st : read_n3_statement(reader); + return st ? st + : (reader->syntax == SERD_NQUADS) ? read_nquads_statement(reader) + : read_n3_statement(reader); } SerdStatus diff --git a/src/reader.h b/src/reader.h index 54914ee5..9b558d1f 100644 --- a/src/reader.h +++ b/src/reader.h @@ -100,6 +100,9 @@ emit_statement(SerdReader* reader, ReadContext ctx, Ref o, Ref d, Ref l); SerdStatus read_n3_statement(SerdReader* reader); +SerdStatus +read_nquads_statement(SerdReader* reader); + SerdStatus read_nquadsDoc(SerdReader* reader); -- cgit v1.2.1