diff options
author | David Robillard <d@drobilla.net> | 2019-03-30 13:02:58 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-03-30 13:02:58 +0100 |
commit | 611094ffa4014ba34e6f2c8dc083878ab6073411 (patch) | |
tree | 4ad7e368c440dd5ee7660d3cfaefb7117cd42c6d /src | |
parent | 5ecd64db399392493cf4f2a5154d1deb3b498c88 (diff) | |
download | serd-611094ffa4014ba34e6f2c8dc083878ab6073411.tar.gz serd-611094ffa4014ba34e6f2c8dc083878ab6073411.tar.bz2 serd-611094ffa4014ba34e6f2c8dc083878ab6073411.zip |
Fix parsing "a" abbreviation without padding whitespace
Diffstat (limited to 'src')
-rw-r--r-- | src/n3.c | 15 |
1 files changed, 2 insertions, 13 deletions
@@ -801,18 +801,6 @@ except: return r_err(reader, SERD_ERR_BAD_SYNTAX, "bad literal syntax\n"); } -inline static bool -is_token_end(uint8_t c) -{ - switch (c) { - case 0x9: case 0xA: case 0xD: case 0x20: case '\0': - case '#': case '.': case ';': case '<': - return true; - default: - return false; - } -} - static bool read_verb(SerdReader* reader, Ref* dest) { @@ -827,8 +815,9 @@ read_verb(SerdReader* reader, Ref* dest) const SerdStatus st = read_PN_PREFIX(reader, *dest); bool ate_dot = false; SerdNode* node = deref(reader, *dest); + const uint8_t next = peek_byte(reader); if (!st && node->n_bytes == 1 && node->buf[0] == 'a' && - is_token_end(peek_byte(reader))) { + next != ':' && !is_PN_CHARS_BASE(next)) { pop_node(reader, *dest); return (*dest = push_node(reader, SERD_URI, NS_RDF "type", 47)); } else if (st > SERD_FAILURE || |