aboutsummaryrefslogtreecommitdiffstats
path: root/src/n3.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/n3.c')
-rw-r--r--src/n3.c32
1 files changed, 5 insertions, 27 deletions
diff --git a/src/n3.c b/src/n3.c
index dc133e69..1374ae7c 100644
--- a/src/n3.c
+++ b/src/n3.c
@@ -4,11 +4,13 @@
#include "byte_source.h"
#include "namespaces.h"
#include "node.h"
+#include "ntriples.h"
#include "read_ntriples.h"
#include "reader.h"
#include "stack.h"
#include "string_utils.h"
#include "try.h"
+#include "turtle.h"
#include "serd/node.h"
#include "serd/reader.h"
@@ -170,33 +172,9 @@ read_PN_LOCAL_ESC(SerdReader* const reader, SerdNode* const dest)
skip_byte(reader, '\\');
const int c = peek_byte(reader);
- switch (c) {
- case '!':
- case '#':
- case '$':
- case '%':
- case '&':
- case '\'':
- case '(':
- case ')':
- case '*':
- case '+':
- case ',':
- case '-':
- case '.':
- case '/':
- case ';':
- case '=':
- case '?':
- case '@':
- case '_':
- case '~':
- return push_byte(reader, dest, eat_byte_safe(reader, c));
- default:
- break;
- }
- return r_err(reader, SERD_BAD_SYNTAX, "invalid escape");
+ return is_PN_LOCAL_ESC(c) ? push_byte(reader, dest, eat_byte_safe(reader, c))
+ : r_err(reader, SERD_BAD_SYNTAX, "invalid escape");
}
static SerdStatus
@@ -492,7 +470,7 @@ read_verb(SerdReader* const reader, SerdNode** const dest)
SerdNode* node = *dest;
const int next = peek_byte(reader);
if (node->length == 1 && serd_node_string(node)[0] == 'a' && next != ':' &&
- !is_PN_CHARS_BASE((uint32_t)next)) {
+ !is_PN_CHARS_BASE(next)) {
serd_stack_pop_to(&reader->stack, orig_stack_size);
return ((*dest = push_node(reader, SERD_URI, NS_RDF "type", 47))
? SERD_SUCCESS