aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-09-23 14:42:00 +0200
committerDavid Robillard <d@drobilla.net>2017-09-23 15:59:22 +0200
commitf8c8f7e02605c10af0b6bc9f1261e893dc825e97 (patch)
tree7364e3d1bba9b7920d32a03c4a680eadcf685169
parent7f965c4bcb94be0ba0c0e73ef7c5c226bad91b8e (diff)
downloadserd-f8c8f7e02605c10af0b6bc9f1261e893dc825e97.tar.gz
serd-f8c8f7e02605c10af0b6bc9f1261e893dc825e97.tar.bz2
serd-f8c8f7e02605c10af0b6bc9f1261e893dc825e97.zip
Report errors for all failing test cases
-rw-r--r--NEWS7
-rw-r--r--src/reader.c11
2 files changed, 11 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index b9bfe65b..da1690ff 100644
--- a/NEWS
+++ b/NEWS
@@ -1,11 +1,10 @@
-serd (0.29.2) unstable;
+serd (0.29.3) unstable;
* Support strict parsing of prefixed names
- * Report errors for directives or abbreviations in NTriples or NQuads
- * Report errors for prematurely terminated statements
+ * Report errors for all failing test cases
* Fix building with MSVC
- -- David Robillard <d@drobilla.net> Sat, 23 Sep 2017 13:54:10 +0200
+ -- David Robillard <d@drobilla.net> Sat, 23 Sep 2017 14:41:49 +0200
serd (0.28.0) stable;
diff --git a/src/reader.c b/src/reader.c
index bdfd23d3..73821584 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -1561,9 +1561,13 @@ read_wrappedGraph(SerdReader* reader, ReadContext* ctx)
while (peek_byte(reader) != '}') {
ctx->subject = 0;
Ref subj = read_subject(reader, *ctx, &ctx->subject, &s_type);
- if (!subj ||
- (!read_triples(reader, *ctx, &ate_dot) && s_type != '[')) {
+ if (!subj && ctx->subject) {
+ return r_err(reader, SERD_ERR_BAD_SYNTAX, "bad subject\n");
+ } else if (!subj) {
return false;
+ } else if (!read_triples(reader, *ctx, &ate_dot) && s_type != '[') {
+ return r_err(reader, SERD_ERR_BAD_SYNTAX,
+ "missing predicate object list\n");
}
pop_node(reader, subj);
read_ws_star(reader);
@@ -1637,7 +1641,8 @@ read_statement(SerdReader* reader)
read_ws_star(reader);
} else if (read_ws_star(reader) && peek_byte(reader) == '{') {
if (s_type == '(' || (s_type == '[' && !*ctx.flags)) {
- return false; // invalid graph with complex label
+ return r_err(reader, SERD_ERR_BAD_SYNTAX,
+ "invalid graph name\n");
}
ctx.graph = subj;
ctx.subject = subj = 0;