aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-07-03 18:40:38 +0200
committerDavid Robillard <d@drobilla.net>2020-10-27 13:13:59 +0100
commitc3f3ecd32a893c084b2d2e8d4228ae9925743d36 (patch)
tree3e277c5fe47cd6ea2b964b29add8806f3e141b23 /src
parentd43267410649b7526e337babf697d7fb26605ddf (diff)
downloadserd-c3f3ecd32a893c084b2d2e8d4228ae9925743d36.tar.gz
serd-c3f3ecd32a893c084b2d2e8d4228ae9925743d36.tar.bz2
serd-c3f3ecd32a893c084b2d2e8d4228ae9925743d36.zip
WIP: Improve writer performance
Diffstat (limited to 'src')
-rw-r--r--src/n3.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/n3.c b/src/n3.c
index 1b1497a6..9648b487 100644
--- a/src/n3.c
+++ b/src/n3.c
@@ -690,7 +690,8 @@ read_IRIREF(SerdReader* reader, SerdNode** dest)
while (!st) {
const int c = eat_byte_safe(reader, peek_byte(reader));
switch (c) {
- case '"': case '<': case '^': case '`': case '{': case '|': case '}':
+ case '"':
+ case '<':
return r_err(reader, SERD_ERR_BAD_SYNTAX,
"invalid IRI character `%c'\n", c);
case '>':
@@ -708,17 +709,18 @@ read_IRIREF(SerdReader* reader, SerdNode** dest)
break;
}
break;
+ case '^':
+ case '`':
+ case '{':
+ case '|':
+ case '}':
+ return r_err(reader, SERD_ERR_BAD_SYNTAX,
+ "invalid IRI character `%c'\n", c);
default:
if (c <= 0x20) {
- if (is_print(c)) {
- r_err(reader, SERD_ERR_BAD_SYNTAX,
- "invalid IRI character `%c' (escape %%%02X)\n",
- c, (unsigned)c);
- } else {
- r_err(reader, SERD_ERR_BAD_SYNTAX,
- "invalid IRI character (escape %%%02X)\n",
- (unsigned)c);
- }
+ r_err(reader, SERD_ERR_BAD_SYNTAX,
+ "invalid IRI character (escape %%%02X)\n",
+ (unsigned)c);
if (reader->strict) {
return SERD_ERR_BAD_SYNTAX;
}